Can I completely rely upon jQuery's html()
method behaving identical to innerHTML
? Is there any difference between innerHTML
and jQuery's html()
method? If these methods both do the same, can I use jQuery's html()
method in place of 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.
Thanks a lot.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…