Asynchronization for Adsense, is that difficult?
Large js codings that calls other files may affect the smoothness of page loading. Large delay on client side is occured so often.
Asynchronized javascript loading is doubtlessly a valid and strong trend to go.
However, many existing synchronized loading methoding methods are not seem to be modified such as the commonly used google adsense.
Let's take adsense as an example. unlike other services that only loaded once in a loading session, adsense has its uniqueness of loading 3 times per session, it makes the situation much complex by the following reasons.
eg. <div id="ads1"></div>
...
<script>load("ads1");load("ads2");load("ads3");</script>
1. identifying iframes to load its ads
2. methods for user to reuse the same code without parameter settings.
3. modern template have different ads on different modules and a global calling with static parameters may stucks
I am going to propose a solution
Due to the speed of computers and mobile devices increased, I supposed that queries for DOMs is possible for a single global calling.
eg. <div class="google_ads" rel="UNIQUE_ID"></div>
or. <div id="google_ads|UNIQUE_ID"></div>
etc...
<script type="text/javascript" src="http://...../load.js></script>
inside (jquery syntax)
$('.google_ads').each(function(){ insert($(this).attr('rel')); }
neat and fine
moreover, I want to complain that the current synchronized loading are buggy that making other iframes drawing inside the wrong advertisement boxes.
That's it.