Hi guys,

I'm very new to Javascript and normally I can find solutions for any issues I have with a quick Google search but this one I just can't find a solution that works.

Essentially all I'm trying to do is insert a bit of adsense code into a part of my site.

The site displays totally fine in Firefox, Chrome and Safari but Internet Explorer is causing me a world of problems.

As you can see in the images below IE won't render the page fully and throws up what looks like an iframe with a 400 error in it...

This is the Firefox version, how I want it to look...

This is the IE version, with the errors...

The code I am using is this:

<!--begin header--!>
<table id="header">
<td id="header-logo"></td>
<td id="header-ad">
<script type="text/javascript">
google_ad_client = "pub-5706391847687826";
/* 468x60, created 20/07/09 */
google_ad_slot = "0680301869";
google_ad_width = 468;
google_ad_height = 60;
<script type="text/javascript"
<!--end header--!>

So far I have tried conditional commenting which doesn't work. I have also tried using a simple Javascript code which shows different text for different browsers, this didn't work either.

Also, if I replace the Adsense code with just a simple bit of text, the page renders the same in both browsers (as the Firefox example above).

Any help is very very much appreciated...


Html comments are <!-- --> and not <!-- --!>.
Try replacing

<!--begin header--!>


<!--begin header-->

and so on in the rest of the html code

I really don't know whether to laugh or cry after spending hours looking for a fix and it turns out to be the comments!

Thanks a million!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.