RE: Java Script Errors from Google Adsense and Tracking?!

Hi Heike,

 

These errors are all easy enough to fix. There’s nothing to worry about, but they are worth fixing.

 

This piece of code is causing ten of the messages:

 

<script>

if(typeof(ip_network)=="undefined" || ip_network=="") var ip_network="www.netzathleten.de";

if(typeof(ip_ord)=="undefined") var ip_ord=Math.round(Math.random()*1000);

if(typeof(ip_tile)=="undefined" || ip_tile=="") var ip_tile=0;

document.write('<scr'+'ipt type="text/javascript" src="http://ad.de.doubleclick.net/adj/www.netzathleten.de/yazio;pack=ernaehrung;theme=;spa=ernaehrung;sz=300x250;tile='+(++ip_tile)+';ord='+ip_ord+'?"><\/script>');

</script>

 

You can replace it with this and it will validate:

 

<script type="text/javascript">

//<![CDATA[

if(typeof(ip_network)=="undefined" || ip_network=="") var ip_network="www.netzathleten.de";

if(typeof(ip_ord)=="undefined") var ip_ord=Math.round(Math.random()*1000);

if(typeof(ip_tile)=="undefined" || ip_tile=="") var ip_tile=0;

document.write('<scr'+'ipt type="text/javascript" src="http://ad.de.doubleclick.net/adj/www.netzathleten.de/yazio;pack=ernaehrung;theme=;spa=ernaehrung;sz=300x250;tile='+(++ip_tile)+';ord='+ip_ord+'?"><\/script>');

//]]>

</script>

 

I made two changes for this. First, I added the required “type” attribute to the <script> tag, as the error explained. Next, I wrapped the contents of the script tag in a CDATA section because you are targeting XHTML. You can find more information about this approach at http://javascript.about.com/library/blxhtml.htm

 

On line 209 you have a <ul> tag inside a <p> tag. It is not valid to nest tags like this:

 

<div class="content"><p><ul>

<li><a href="http://www.lebensmittellexikon.de/" alt="Alles rund um Wein im lebensmittellexikon" target="_blank">Lebensmittellexikon</a> <img src="/themes/yazio/images/link-out.gif" width="10" height="10" alt="Externer Link" /></li>

</ul>

</p>

</div>

 

If you remove the <p> tag here you will be fine.

 

Also in this block of code, you have an “alt” attribute on the <a> tag. As the corresponding error states, this is not valid. I think you might be wanting to use the “title” attribute instead.

 

These simple changes will get you 90% of the way there. Try and fix these errors, upload your page and test it again with the validator. Email us again if you have any more trouble.

 

Thank you for caring about web standards!

 

 

--

Tatham Oddie

au mob: +61 414 275 989, us cell: +1 213 280 9140, skype: tathamoddie

 

From: www-validator-request@w3.org [mailto:www-validator-request@w3.org] On Behalf Of meike.haschi@freenet.de
Sent: Sunday, 20 June 2010 6:43 AM
To: www-validator@w3.org
Subject: Java Script Errors from Google Adsense and Tracking?!

 

Hello, I am the webmaster of http://www.yazio.de - I am trying to get our webpage passing the w3c validator. Unfortunetly I am getting several Errors from JS - for example like Google Adsense Code and other JS tracking code - is there anything I can do or should I not worry about?

 

Thank you!

 

Take care,

Heike

 

freenetMail mobil – Alle E-Mails auf Ihrem Handy versenden und empfangen.
Jetzt kinderleicht und kostenlos einrichten. Hier informieren! <http://tls.freenet.de/tipp/handymail/index.html> 

Received on Monday, 21 June 2010 15:05:30 UTC