View Full Version : :confused: Problem with IE loading js file

06-13-2008, 09:38 PM
Hi all,

My company's website has a js script implemented on all its pages for a specific task. This script sometimes slows down loading of the page for some users so
I wanted to load that file after the complete page is loaded so that the visitor on the site does not feel any problem. I found one solution which is working perfectly with firefox but it is causing "Operation Aborted" error with IE. Here is the code:

<script type="text/javascript">
var body= document.getElementsByTagName('body')[0];
var script= document.createElement('script');
script.type= 'text/javascript';
script.src= 'Myfile.js';

if anyone could tell me the reason of error in IE then that would be great. Thanks in advance.

06-13-2008, 11:25 PM
Just taking a stab here. You may need to wrap that in a function and call it with an onload. It may be trying to append before the body or body tag is loaded.

06-14-2008, 12:10 AM
Thanks for your reply but I have found the solution on: http://blogs.msdn.com/ie/archive/2008/04/23/what-happened-to-operation-aborted.aspx
Actually I was having the problem because tags.