Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

ajax.status not working with firefox 6 - always returns status 0. This feature is basic, was working with firefox 5. What have you done and how can I make my website work again with ajax?

more options

I am developing websites using ajax. With firefox 6 ajax.status is only returning 0 not 200. I have not changed my code. It works with earlier versions of Firefox and with Chrome 13. I have defined a javascript variable ajax1 at beginning of program, typical procedure.

function ajaxFunction(){ var ajaxRequest; // The variable that makes Ajax possible!

 if (window.XMLHttpRequest) {
  // IE 7, Mozilla, Safari, Firefox, Opera, most browsers:

ajaxRequest = new XMLHttpRequest();

  } else if (window.ActiveXObject) { // Older IE browsers
   	// Create type Msxml2.XMLHTTP, if possible:

try { ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e1) { // Create the older type instead: try { ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) { } } } // Send an alert if the object wasn't created. if (!ajaxRequest) { alert ('Some page functionality is unavailable.'); } else {

return ajaxRequest;
}

var ajax1 = ajaxFunction(); var ajax2 = ajaxFunction();

This code below does not not work because firefox 6.02 is not returning anything but 0 for the status: if (ajax1.readyState == 4) && (ajax1.status == 200){

You have done something with your javascript engine that is causing this problem. How can I get ajax to work using post method - am using code like this which WAS working in earlier versions of firefox:

var post_data = 'email=' + encodeURIComponent(email);              
    ajax1.open('post', 'check_4_company.php',true);
    ajax1.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    ajax1.onreadystatechange = handle_mope;
    ajax1.send(post_data);
    return false;

This code is very basic, have used it hundreds if not thousands of times successfully!

But firefox 6 has messed things up!

Please advise!

jimfre bacal

I am developing websites using ajax. With firefox 6 ajax.status is only returning 0 not 200. I have not changed my code. It works with earlier versions of Firefox and with Chrome 13. I have defined a javascript variable ajax1 at beginning of program, typical procedure. function ajaxFunction(){ var ajaxRequest; // The variable that makes Ajax possible! if (window.XMLHttpRequest) { // IE 7, Mozilla, Safari, Firefox, Opera, most browsers: ajaxRequest = new XMLHttpRequest(); } else if (window.ActiveXObject) { // Older IE browsers // Create type Msxml2.XMLHTTP, if possible: try { ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e1) { // Create the older type instead: try { ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) { } } } // Send an alert if the object wasn't created. if (!ajaxRequest) { alert ('Some page functionality is unavailable.'); } else { return ajaxRequest; } var ajax1 = ajaxFunction(); var ajax2 = ajaxFunction(); This code below does not not work because firefox 6.02 is not returning anything but 0 for the status: if (ajax1.readyState == 4) && (ajax1.status == 200){ You have done something with your javascript engine that is causing this problem. How can I get ajax to work using post method - am using code like this which WAS working in earlier versions of firefox: var post_data = 'email=' + encodeURIComponent(email); ajax1.open('post', 'check_4_company.php',true); ajax1.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); ajax1.onreadystatechange = handle_mope; ajax1.send(post_data); return false; This code is very basic, have used it hundreds if not thousands of times successfully! But firefox 6 has messed things up! Please advise! jimfre bacal

所有回覆 (1)

more options

Further discussion here: ajax problems with firefox 6 at mozillaZine Forums