View Full Version : Included code causing validation errors

06-28-2007, 09:50 AM
I have a banner being called in from an Adserver programme:

<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:


Could someone help me to rectify this?


06-28-2007, 10:02 AM
Move the stuff inside the script tags to an external js file and call it using

<script type="text/javascript" src="urltoexternal.js"></script>

06-28-2007, 11:27 AM
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.


06-28-2007, 06:19 PM
It comes up as valid to me.