I\'m trying to understand how JSFiddle \'wraps\' code in \'onLoad\' based on this description: [1]: http://doc.jsfiddle.net/basic/introduction.html#javascript. I\'ve seen on
It makes a new iframe to run your code in.
For the onload, they just put all your code in
window.onload = function () {
// your code here
};
You can see this if you inspect the tag in the of the bottom-right iframe.
Nothing wrong with using $(document).ready(... but it's kinda useless when you enable the onLoad option in jsFiddle.