使用 Ajax 发布文本时 IE 崩溃且没有错误消息

发布于 2024-10-01 08:50:51 字数 170 浏览 0 评论 0原文

由于标题是不言自明的,我有一个 html 文本区域和一个 HTML 输入类型=“按钮”。我简单地调用一个 asmx Web 服务(通过 ScriptManager、ms ajax fw)。我调用该服务来发送文本并保存到数据库。调用此服务几次后,IE (8) 崩溃,没有任何错误消息。任何线索将不胜感激。

谢谢!

As the title is self explanatory, I have a html textarea and a HTML input type="button". Simply I call an asmx web service (via ScriptManager, ms ajax fw). I call the service to send the text and save to DB. After calling this service a few times, IE (8) crashes with no error msg whatsoever. Any leads will be appreciated.

Thx!

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

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

发布评论

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

评论(1

↘人皮目录ツ 2024-10-08 08:50:51

我们遇到过听起来类似的问题。
IE在调用AJAX方法后会崩溃(我们使用jquery的ajax)。

从 Web 方法成功返回后,JavaScript 将用返回的内容替换元素的 innerhtml。

崩溃的原因是当某些动态值为 null 时原始 html 中的自关闭标签元素所致:

   <label id="sometext" />

IE 8 似乎无法正确处理此自关闭元素。当成功方法尝试替换innerHTML时,DOM不正确并且IE崩溃。

为了纠正这个问题,我们现在在标签中强制添加一个空格,以防返回 null:

   <label id="sometext"> </label>

Firefox、chrome 和其他版本的 IE 似乎可以正确处理自关闭标签。

We have come across what sounds like a similar issue.
IE would crash after calling and AJAX method (we used jquery's ajax).

On successfully returning from the web method, the javascript replace the innerhtml of an element with what was returned.

The cause of the crash was due to a self closing label element in the original html when some dynamic value was null:

   <label id="sometext" />

IE 8 does not seem to process this self closing element properly. When the on success method tries to replace the innerHTML the DOM was not correct and IE crashed.

To correct the issue we now force a space into the label in case a null was returned:

   <label id="sometext"> </label>

Firefox, chrome and other versions of IE seem to handle the self closing tag correctly.

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