我有一个jquery函数,可对Web服务器上的Webservice方法进行Ajax调用,该方法返回一个包含数据的html表.我正在使用.html()在div上呈现返回值.这可以在Firefox,Chrome,Safari中使用,但不能在IE8上使用
I have a jquery function which makes an ajax call to a webservice method on the web server, the method returns a html table with data. I am using .html() to render the return values on div. This works in Firefox,Chrome, Safari but does not work on IE8
$.ajax({ type: "POST", url: "./../WebAjaxCalls.asmx/GetProductInstruction", data: "{'ProductID':'" + $("#txtProductID").val() + "'}", success: function(data) { if (data.d[0] == "true") { **$("#dvProudctInstruction").html(data.d[1]);** } }, contentType: "application/json; charset=utf-8", dataType: "json", error: function(e, textStatus, errorThrown) { bReturn = false; } });$(#dvProudctInstruction").html(data.d [1]); 行适用于除IE8之外的所有浏览器.
The line $("#dvProudctInstruction").html(data.d[1]); works on all browsers except IE8.
在此方面的任何帮助将不胜感激.
Any help on this will be much appreciated.
推荐答案您可以在将响应分配给html()
You could alert your response before assigning it html()
OR
您可以使用innerHTML属性代替jquery的html()(尽管相同)
You could use innerHTML property instead html() of jquery (though it's same)
您可能要检查此链接
更多推荐
jQuery .html()在ie8上不起作用
发布评论