| Country Rank: | 2 |
|---|---|
| World Rank: | 25 |
| Profile Viewed: | 395 |
| Points: | 11495 |
|
09 Oct
2010
|
Defer Javascript execution without defer attr
By: Daniele Cruciani
|
Why do defer javascript execution?
First of all there is a problem of performance, second most time you want to control exactly when a function is executed.
This could be done without defer attribute using data structure specified in json notation:
Then execute at page load all javascript in the order you choose, also calling (using jQuery for example):$("."+class).each(function(i,el){ eval('m.push('+$(el).html()+');'); });