Forum Moderators: open

Message Too Old, No Replies

Can not insert AdSense by javascript

turned out to be more complicate than expected

         

jetteroheller

1:11 am on Jan 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I want to deliver gzip compressed html, so SSI server side include will not work anymore.

So I thought to store the AdSense code in the javascript

mt=new Array();

mt['nav300x250']=" Here goes the AdSense code for 300x250 ";

First I thought to insert it by innerHTML.

But it seems javascript in innerHTML is ignored.

But even with

document.write( mt['nav300x250'] );

nothing happens. Any idea why?

methode

4:01 pm on Jan 28, 2009 (gmt 0)

10+ Year Member



First of all, let's clear that up that gzip will work only on browsers which supports it. On a medium traffic site i saved almost a stunning 1gig per month with it, which is about .0001% of the total transfer. The fuss about gzip is often bigger than the effectiveness.

secondly, i smell that when you insert the adsense code in the reserved place, that just brakes the javascript.
innerHTML should work.

jetteroheller

12:41 pm on Jan 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



First of all, let's clear that up that gzip will work only on browsers which supports it.

What browser supporting AdSense is not able to display gzip compressed files?

AFAIK not one.

BTW, it's not about band width.

The compressed delivery even indreased band width

It's about first user experience, to display as fast as possible content.

The whole page with all files is maybe more than 200 kb,
but rendering the content can start after 4 kb compressed html file.