...

View Full Version : Included code causing validation errors



daemonkin
06-28-2007, 08: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:

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.twsports.org&charset=%28detect+automatically%29&doctype=Inline

Could someone help me to rectify this?

D.

_Aerospace_Eng_
06-28-2007, 09: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>

daemonkin
06-28-2007, 10: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.

D.

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum