我能否完全依赖jQuery的html()
方法,其行为与innerHTML
相同?innerHTML
和jQuery的html()
方法有什么区别吗?如果这两种方法都是一样的,我可以用jQuery的html()
方法代替innerHTML
吗?
My problem is: I am working on already designed pages, the pages contains tables and in JavaScript the innerHTML
property is being used to populate them dynamically.
The application is working fine on Firefox but Internet Explorer fires an error: unknown runtime exception
. I used jQuery's html()
method and IE's error has disappeared. But I'm not sure it will work for all browsers and I'm not sure whether to replace all innerHTML
properties with jQuery's html()
method.
谢谢.