5
rated 0 times
[
7]
[
2]
/ answers: 1 / hits: 33860
/ 15 Years ago, tue, december 8, 2009, 12:00:00
I need to add prototype and then add scriptaculous and get a callback when they are both done loading. I am currently loading prototype like so:
var script = document.createElement(script);
script.src = http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js;
script.onload = script.onreadystatechange = callback;
document.body.appendChild( script );
I could do this by chaining the callbacks, but that seems like poor practice ( I don't want a silly chain of 20 callback methods when I need to load more scripts). Ideas?
More From » dom