Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

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