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

  • Home
  • SEARCH
  • 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 6023847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:04:00+00:00 2026-05-23T04:04:00+00:00

I am experiencing a strange problem where IE8 will fire readyState 4 three or

  • 0

I am experiencing a strange problem where IE8 will fire readyState 4 three or four times on an ajax request. This happens often but not always, and only for a couple of specific links – the rest of my ajax links are fine. My object creation and onreadystatechange handler are basic, ie.

function ajaxPost(params) {

    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    } catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {
                alert('Unsupported Browser');
            }
        }
    }

    xmlHttp.onreadystatechange = function() {
        if (xmlHttp.readyState == 4) {
            // Do something
        }
    }

    xmlHttp.open("POST", path_to_script);
    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
    xmlHttp.setRequestHeader("Cache-Control", "must-revalidate");
    xmlHttp.send(params);
}

Not sure if this is relevant – but at the points where the problem happens the user has already been navigating an ajax UI. They have clicked several other ajax links without reloading the page – each link uses a new xmlHttpRequest object with the same global variable name (xmlHttp), but each ajax request finishes before another can be issued. Do I need to do any “cleanup” or something for IE8? This has never happened using Safari, Firefox, Chrome, or any other browser.

Any insight would be much appreciated.

Thanks, Brian

  • 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-05-23T04:04:01+00:00Added an answer on May 23, 2026 at 4:04 am

    Since your xmlHttp object is global, may be IE8 assigns a new onreadystatechange each time you call ajaxPost instead of replacing it.

    That may explain an erratic behavior, as it depends on the number of calls to ajaxPost.

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

Sidebar

Related Questions

I'm experiencing a rather strange problem with foreign keys, namely this doesn't work as
I'm experiencing a similar problem to this guy except my problem is related to
I'm experiencing a strange issue where my Visual Studio 2005 C++ program crashes the
I'm experiencing something really strange! I have a div that I'm hiding with JS
Our team has been experiencing a recurring problem with velocity templates. Upon rendering, some
I am experiencing a problem with Swing that only occurs when the computer monitor
I'm experiencing a weird problem which I hope someone in here may be able
I'm experiencing a weird problem with stringstream . #include stdafx.h #include iostream #include sstream
I am experiencing a problem where Rational Application Developer 8 consistently hangs indefinitely on
After experiencing numerous problems with a certain media player, it got me thinking is

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.