'onload' handler for 'script' tag in internet explorer
I've been using this function to attach onload handler to a script tag, it seems to be the recommended way over the internet. Yet, it doesn't work in internet explorer, if page is loaded already (tested in ie 8). You can see that it works in normal browsers (fires alert when script is loaded). Am I missing something? Thank you SLaks You should call jQuery.getScript , which does exactly what you're looking for. EDIT : Here is the relevant source code from jQuery: var head = document.getElementsByTagName("head")[0] || document.documentElement; var script = document.createElement("script"); if (