使用 Ajax 发布文本时 IE 崩溃且没有错误消息
由于标题是不言自明的,我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们遇到过听起来类似的问题。
IE在调用AJAX方法后会崩溃(我们使用jquery的ajax)。
从 Web 方法成功返回后,JavaScript 将用返回的内容替换元素的 innerhtml。
崩溃的原因是当某些动态值为 null 时原始 html 中的自关闭标签元素所致:
IE 8 似乎无法正确处理此自关闭元素。当成功方法尝试替换innerHTML时,DOM不正确并且IE崩溃。
为了纠正这个问题,我们现在在标签中强制添加一个空格,以防返回 null:
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:
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:
Firefox, chrome and other versions of IE seem to handle the self closing tag correctly.