将 div insidehtml 设置为包含表的源

发布于 2024-09-05 11:29:09 字数 277 浏览 1 评论 0原文

我认为我想做的事情很简单,但显然与 IE 相关的事情从来都不是简单的。

我将其与 Javascript 和 ajax 一起使用 -

document.getElementById("calender").innerText=mypostrequest.responseText

它在 Firefox 和 IE7 中工作正常,但在 IE8 中不行。我怀疑这是因为文本包含表格,因为我已经用其他文本对其进行了测试。我无法更换桌子。有什么办法可以解决这个问题吗?

I thought what I was trying to do is quite simple, but apparently nothing related to IE is ever simple.

I'm using this with Javascript and ajax -

document.getElementById("calender").innerText=mypostrequest.responseText

It works fine in Firefox and IE7, but not IE8. I suspect it's because the text contains a table, since I have tested it with other text. I can't replace the table. Is there any way to get around this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

煞人兵器 2024-09-12 11:29:09

尝试

document.getElementById("calender").innerHTML=mypostrequest.responseText

Try

document.getElementById("calender").innerHTML=mypostrequest.responseText
一杆小烟枪 2024-09-12 11:29:09

切换到 jQuery

( $('#calender').html(mypostrequest.responseText) )

现在可以使用了。

Switched to jQuery

( $('#calender').html(mypostrequest.responseText) )

It works now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文