$.getScript('empty.js',function(){alert('a');});
On Jan 17, 12:20 pm, Justin Meyer <[EMAIL PROTECTED]> wrote: > Does anyone know how to make IE load and run empty.js before it alerts > "second"? > > Here's how I started doing it. But this doesn't work. > > document.write("<script type=\"text/javascript\" src=\"/javascripts/ > empty.js\"><\/script>"); > document.write("<script type=\"text/javascript\">alert(\"second\")<\/ > script>") > > This works if IE has cached empty.js. > > setTimeout(function(){ > var el = document.createElement('script') > el.type = 'text/javascript' > el.src='javascripts/empty.js' > document.body.appendChild(el) > > },1) > > setTimeout(function(){ > var el2 = document.createElement('script') > el2.type = 'text/javascript' > el2.text='alert(\"second\")' > document.body.appendChild(el2) > > > > },1)- Hide quoted text - > > - Show quoted text -