以下幾段代碼在除IE之外的所有內容中都很適用。在IE中,data.responseText
的警報說未定義。但在所有其他瀏覽器中,它會返回正確的數據。jquery ajax responseText不能在ie9中工作
我錯過了什麼?它適用於Firefox,Chrome,Safari等。
如果我將data.responseText
更改爲只是數據,我得到[object Object]
。
$.ajax({
type: "POST",
url: "",
data: "command=loadComments&id=" + song_id,
dataType: "html",
complete: function(data) {
loading.fadeOut('slow');
$("#comments-list").fadeIn('slow', function() {
$("#comments-list").html(data.responseText);
alert(data.responseText);
});
}
});
嘗試數據= eval(數據)..第一行在功能...並改變完成成功.. –