为什么IE在设置innerHTML时会出现意外错误 [英] Why does IE give unexpected errors when setting innerHTML

查看:134
本文介绍了为什么IE在设置innerHTML时会出现意外错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在firefox中的一个元素上设置innerHTML并且它工作正常,在IE中尝试并且出现意外错误而没有明显的原因。

I tried to set innerHTML on an element in firefox and it worked fine, tried it in IE and got unexpected errors with no obvious reason why.

例如,如果你尝试将表的innerHTML设置为hi from stu它将失败,因为该表必须后跟一个序列。

For example if you try and set the innerHTML of a table to " hi from stu " it will fail, because the table must be followed by a sequence.

推荐答案

显然firefox不是这个挑剔==>显然FireFox是如此的错误,它没有注册这个明显违反基本的html嵌套规则......

"Apparently firefox isn't this picky" ==> Apparently FireFox is so buggy, that it doesn't register this obvious violation of basic html-nesting rules ...

正如有人在另一个论坛中指出的那样,FireFox会接受,你将一个完整的html文档附加为表单字段或图像的子项, - (

As someone pointed out in another forum, FireFox will accept, that you append an entire html-document as a child of a form-field or even an image ,-(

这篇关于为什么IE在设置innerHTML时会出现意外错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆