Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    :confused: Problem with IE loading js file

    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';
    body.appendChild(script);
    </script>

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

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    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.

  • #3
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your reply but I have found the solution on: http://blogs.msdn.com/ie/archive/200...n-aborted.aspx
    Actually I was having the problem because tags.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •