Valid... do you know

Discussion in 'HTML & Website Design' started by oo7ml, Mar 5, 2008.

  1. #1
    I have been focusing on valid xhtml for the last few weeks and i have found so many annoying little things with it. I have two questions:

    1. How do you create a link that will open up in a new window becasue the target="_blank" seems to be invalid xhtml in the following line:
    <a href="newpage.html" target="_blank">link</a>


    2. the language="JavaScript" also seems to be invalid code in the following line:

    <script language="JavaScript" type="text/javascript" src="js/conveyor.js"> </script>

    Is it ok to use just: <script type="text/javascript" src="js/conveyor.js"> </script>

    thanks in advance
     
    oo7ml, Mar 5, 2008 IP
  2. xubz

    xubz Peon

    Messages:
    18
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    1. I suppose you are trying to use xHTML Strict. AFAIK, There is no other work around for the target="_blank" if you want _pure_ xHTML.

    You can make it xHTML-Transitional. That'll not be as stricter as 'Strict' :)

    2. Yup! You can use just <script type="text/javascript" src="js.js"></script>.
    In Fact, the 'language' element was deprecated in HTML 4.01 Standard itself! (forget about it in xHTML! :-\)
     
    xubz, Mar 5, 2008 IP
  3. oo7ml

    oo7ml Well-Known Member

    Messages:
    656
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #3
    no other work around for the target="_blank"... that's bit mad, considering strict xhtml is ment to be the way forward... i have also came across other bugs (maybe i shouldn't be calling them bugs as there is probably a very good reason why certain things (such as target="_blank") are not allowed... thanks for your help anyway
     
    oo7ml, Mar 5, 2008 IP
  4. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It is the way forward-- forcing browsers to open a new window no matter what is considered backwards (imagine how much of a pain this is using a text browser or a screen reader--- it's difficult at best for accessibility).

    The few times where it really really makes sense to open a new window (like the popup box that appears when you log out of here, for instance-- small and moves focus from the main window until it's been dealt with) there is a Javascript version. You have a link, rel="external", and then Javascript opens a new window... those without Js still have a working link.

    But people like me prefer to open links in new tabs, so I can remember where I was, and STILL have a Back button (the really bad thing about target=blank-- the Back button is the most used button on teh Interwebz).

    This is why it has been removed from both HTML4.01 Strict (I think) and XHTML Strict. Yes, you can back down to Transitional to have a valid site, OR you could keep the target if you're loath to remove it-- your site won't be valid but the code will still work.

    *edit I didn't see but xubz had already answered the javascript one : )
     
    Stomme poes, Mar 5, 2008 IP
  5. oo7ml

    oo7ml Well-Known Member

    Messages:
    656
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #5
    Ok cool, thanks again
     
    oo7ml, Mar 5, 2008 IP