Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Location
    N. Ireland
    Posts
    351
    Thanks
    16
    Thanked 4 Times in 4 Posts

    Included code causing validation errors

    I have a banner being called in from an Adserver programme:

    Code:
    <script type='text/javascript' src='http://www.ncdstudio.co.uk/adserver/adx.js'></script>
    <script type='text/javascript'>
    <!--
       if (!document.phpAds_used) document.phpAds_used = ',';
       phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
    
       document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
       document.write ("http://www.ncdstudio.co.uk/adserver/adjs.php?n=" + phpAds_random);
       document.write ("&amp;what=zone:9");
       document.write ("&amp;exclude=" + document.phpAds_used);
       if (document.referrer)
          document.write ("&amp;referer=" + escape(document.referrer));
       document.write ("'><" + "/script>");
    //-->
    </script><noscript><a href='http://www.ncdstudio.co.uk/adserver/adclick.php?n=aedc1c20' target='_blank' ><img src='http://www.ncdstudio.co.uk/adserver/adview.php?what=zone:9&amp;n=aedc1c20' alt='' /></a></noscript>
    But this included code is causing validation errors:

    http://validator.w3.org/check?uri=ht...doctype=Inline

    Could someone help me to rectify this?

    D.
    Daemonkin.
    If this was helpful, please add to my reputation
    Thousand Sons - Freelance Web Developer - ninetyonedegrees.com

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Move the stuff inside the script tags to an external js file and call it using
    Code:
    <script type="text/javascript" src="urltoexternal.js"></script>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Jun 2007
    Location
    N. Ireland
    Posts
    351
    Thanks
    16
    Thanked 4 Times in 4 Posts
    Thanks Aero. I tried that but get the same validation problems.

    I moved the js commands to a file called bannerscript.js and placed it in my js directory and linked to it but to no avail.

    D.
    Daemonkin.
    If this was helpful, please add to my reputation
    Thousand Sons - Freelance Web Developer - ninetyonedegrees.com

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    It comes up as valid to me.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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