Catch up on stories from the past week (and beyond) at the Slashdot story archive


Forgot your password?

Comment Eh? (Score 1) 525

A real way to include other javascript files.

The "real" way is via the DOM.

function include(url){
var s = document.createElement("script");
s.setAttribute("type", "text/javascript");
s.setAttribute("src", url);
var nodes = document.getElementsByTagName("*");
var node = nodes[nodes.length -1].parentNode;

A well defined way to say "The page is loaded, all your variables and objects are loaded, Time to execute!" rather then "You can only see the variables and objects that are defined 'above' you and not 'below' you in unloaded portions of the page".

window.onload is the DOM event you're looking for.

If entropy is increasing, where is it coming from?