On Feb 9, 2006, at 5:04 AM, Jorrit wrote:

Let put it this way:
Why isn't there something like this in MochiKit:
targetDiv = getElement('head');
targetDiv.appendChild(SCRIPT ({"id":"something"",src":"getmyjavascript.php?script=something"});

That's not normally a very useful way to load code because it's not synchronous in all browsers, and you have no idea when it loaded.

The only way to load code cross-browser *and* know when it was loaded is to use XMLHttpRequest to do it, which makes debugging damn near impossible because you lose a lot if the code was eval'ed instead of inserted into the DOM.

The reason that MochiKit doesn't have any of this natively is because it's not normally the right solution, so I've never really wanted that functionality.

-bob

Reply via email to