Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8775367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:47:05+00:00 2026-06-13T18:47:05+00:00

I have a situation where I load a parent web page (happens to be

  • 0

I have a situation where I load a parent web page (happens to be Java JSP) which has content I am loading using ajax (asynch) inside of a document ready function expecting the page to render whatever it can quickly then run the jquery code to perform asynch work after the page is displayed.

It works just as expected in firefox – page renders quickly and then the jquery code runs ajax calls loading other elements.

In IE8 it waits until everything is done, then renders the completed results. It does not honor my document ready attempt. It sits there loading the page while running my code in the document ready section, then finally the completed results of everything is plopped on the browser.

Is there any workaround? Any way to get IE8 to behave like Firefox in this regard … render the page ASAP and then run some jquery code/ajax calls AFTER rendering?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:47:06+00:00Added an answer on June 13, 2026 at 6:47 pm

    This is a bug that affects IE6 7 and 8. jQuery’s document ready handler doesn’t fire until right before or right after the window load event in IE 6 7 and 8. This does not happen in IE9.

    One way to fix it is to handle the event yourself.

    <body class="jquerydomready">
        <!--[if lt IE 9]>
        <script>
            $('body').removeClass('jquerydomready');
        </script>
        <![endif]-->
    

    and then in your script use this:

    function init() {
        // code here will be ran when document is ready
        $("body").css("background-color","green");
    }
    
    if ( $("body").is(".jquerydomready") ) {
        $(init); // not oldIE
    }
    else {
        // oldIE way
        document.onreadystatechange = function() {
            if (document.readyState == "interactive") init();    
        }​
    }
    

    Keep in mind though that if you are performing ajax requests and expecting them to happen quickly or else code won’t work, i suggest moving to a system that doesn’t require them to happen quickly because you can’t rely on the network always being quick.

    ticket: http://bugs.jquery.com/ticket/12282

    It currently is not actually marked as a bug, but if you follow the history on this issue it has been fixed and unfixed several times throughout the development of jQuery.

    Edit: I’m not entirely sure on the IE6 part of this answer, i haven’t tested IE6 with this.

    Here’s a supporting JSFiddle showing that it improperly waits in IE7 and 8 (again not tested in IE6).

    Before the above fix: http://jsfiddle.net/PFWmS/

    After the above fix: http://jsfiddle.net/PFWmS/7

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a situation where I'm loading some content using a URLLoader but the
I have a situation where I need to ignore parts of page load sub
I have a situation on a single page web application. I use address information
I have a question about jQuery load best practice. Imagine the following situation: $(#div).on('click',
I have situation in which I read a record from a database. And if
Pseudo-situation: have a class (let's say BackgroundMagic ), and it has Start() and Stop()
We are using Twitter Bootstrap for my application. I have situation where I have
So I have a situation where there is an ajax call made after a
I have a situation where I need to integrate a gwt dialog (which to
I have typical situation where big loop is loading lots of images and its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.