Jump to content

reuse xmlhttprequest object / internet explorer problem, firefox works


rbrunold

Recommended Posts

Hello together,

 

I'm currently working on a page that contains a toggle button to switch a program execution flag in a database.

The onclick event in the html page generates a get request to a server side php script which toggles that database field and reports back a xml document which contains the current status.

 

When I open the html page on the internet explorer and push that button, I see the request being sent  and the correct answer coming back. When I push the button again I do not see that any further request to the server is sent. No error occurs, but the responseXML contains always the information from the first xml document I received. Closing the browser and reopening it will show the same. The first request is okay, every further one will just show the xml document from the first.

 

This happens only with the internet explorer. Firefox works without any problem.

 

This is the code I use to send the get request and process the answer.

 

function toggle_queue_processor() {
  qpstatus.open("GET", "modify_queue_processor.php", true);
  qpstatus.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
  qpstatus.onreadystatechange = function() { process_queue_processor_state(); }
  qpstatus.send(null);
}

function process_queue_processor_state() {
  if (qpstatus.readyState == 4) {
    if (qpstatus.status == 200) {
      answer = qpstatus.responseXML;
      ...

 

I tried to set no cache header options in the xml document and several other options in the javascript code but nothing helped.

 

Any help would be great !

 

Thanks

Rainer

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.