SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2000
    Location
    UK, Scotland
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am hoping someone might be able to help me?

    I realise the attributes margin aren't attributes in the HTML standard.

    So I included this in my web page as someone suggested:

    <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
    <!--
    var NAV=navigator;
    if((NAV.appName=='Netscape')&&(parseInt(NAV.appVersion)<=4)) {
    document.write('<BODY MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" TOPMARGIN="0">')
    }
    //-->
    </SCRIPT>

    Then <BODY STYLE="margin:0px"> for IE.

    This is done on my website at:

    http://www.tulliallan.police.uk

    The page now validates fine and conforms.

    My question is? I included this script into the head section of my HTML page and was wondering if this is the correct place to hold the script or should it come just after the body tag?

    I am hoping I have placed it in the correct location!

    I would be really grateful for some advice on this thanks.

  2. #2
    Anyone seen my cypher? OneChance's Avatar
    Join Date
    Apr 2001
    Location
    Seattle
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After the BODY tag? That JavaScript basically is your BODY tag. Take out your existing BODY tag and put this JavaScript in its place. You're not supposed to have multiple BODY tags, and you certainly shouldn't have any within the HEAD. But why go to such lengths just to validate?

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2000
    Location
    UK, Scotland
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    BODY

    It doesn't actually come up any errors so would this be OK or would I have to actually change this?

    In the body tag I have set some other attributes which I require so what would be the best solution here to do?

  4. #4
    Anyone seen my cypher? OneChance's Avatar
    Join Date
    Apr 2001
    Location
    Seattle
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't understand what you're trying to accomplish. If you really want to validate, then remove that JavaScript altogether. I don't see why you would hide it just to validate, then have it written into the page (in the HEAD section no less) when your page renders, basically negating the validation.

    You're probably not getting any errors since the validator checks your HTML, not your JavaScript code and most likely not even the results of the code.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •