我使用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