jQuery .html()在ie8上不起作用

编程入门 行业动态 更新时间:2024-10-18 10:18:53
本文介绍了jQuery .html()在ie8上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个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上不起作用

本文发布于:2023-11-25 01:54:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627836.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:上不   jQuery   html

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!