2011-06-15 134 views
0

我試圖自己解決這個問題,但經過3天的搜索和閱讀文章,我決定尋求幫助。在所有瀏覽器旁都可以正常工作,即(7,8,9)。 Firebug也不會在ie中返回任何錯誤(https://getfirebug.com/firebug-lite-debug.js) 我不知道我在做什麼錯誤...請幫助。jquery和json沒有HTTP響應即

       $.ajax({ 
          url: review_form.attr('action'), 
          type: 'POST', 
          data: formData, 
          dataType: 'json', 
          cache: false, 
          contentType: 'application/json', 
          success: function(data) { 
           if(data['status'] == "OK") { 
            $('#feedback').text('Konto zostało poprawnie dodane.'); 
            setTimeout(function(){window.location.href = data['redirect']},3000); 
           } 
           else { 
            $.each(data, function(key, value) { 
             // The edit was unsuccessful, put in the error messages. 
             var UL = $('#frm_reg input[name=' + key + ']').closest('p') 
              .prepend('<ul class="errorlist"></ul>') 
              .find('ul'); 
             $.each(value, function() { 
              UL.append("<li>" + this + "</li>"); 
             }); 
            }); 
           } 
          }, 
          error: function(xhr, status, error) { 
           alert(status); 
          } 
         }); 

我發現錯在我的形式,有錯字的 「行動」

<form method="post" action="{{ registration_register }}" id="frm_reg"> 

一切似乎看起來不錯,但...;)之後我刪除螢火-LITE它停止工作即ie 7和8 ....

+0

你有fiddler2嗎?它將幫助我們調試請求正在發送的天氣,以及返回的內容。 http://www.fiddler2.com/fiddler2/ – Patricia 2011-06-16 13:15:44

回答

1

它很可能即緩存您的結果。

嘗試添加:

$.ajaxSetup({ 
    // Disable caching of AJAX responses */ 
    cache: false 
}); 

到您的文檔準備。

+0

它仍然是一樣的情況,這個改變沒有... – Pawel 2011-06-15 22:55:59

1

在Internet Explorer 9中,您也可以通過按F12使用開發人員工具欄並轉到網絡選項卡。按「開始捕捉」,你應該能夠看到什麼信息正在出去並回來。或者如果這不起作用,提琴手可以幫助看看你是否真的發出ajax呼叫?

您是否還檢查過url屬性是否正確?