我使用ajax將一些數據傳到我的頁面,並使用.html()更改div的html內容。 一切工作正常在Firefox,谷歌鉻,Safari瀏覽器,歌劇除了INTERNET EXPLORER。.html()不能在Internet Explorer中工作
IE 7,8,9無法響應.html()函數,該div的內容保持不變。
這裏是我的代碼:
var userurl = $('#userthumb a').attr('href');
$(document).ready(function(){
$('#userthumb').after("<div id='to-change'>Loading...</div>");
$.ajax({
type: "GET",
url: "parse.php",
data: "url=" + userurl,
dataType: 'json',
cache: false,
success: function(data)
{
var respond = data['respond'];
$('#to-change').html(respond + 'profile');
} //end of success
}); //end of ajax
});
有任何問題或者是有解決IE問題的方法嗎?
返回的HTML是什麼樣的?缺少標籤會對IE造成嚴重破壞。 –
重複與http://stackoverflow.com/questions/412734/jquery-html-attribute-not-working-in-ie – ComfortablyNumb
只是一個JSON {「respond」:「用戶名」} – sm21guy