Firefox vs. IE: innerHTML processing

After several hours of debugging, it seems to me that in FireFox innerHTML DOM reflects what is actually in the markup, but in IE innerHTML reflects that in the markup PLUS any changes made by the user or dynamically (i.e. through Javascript) .

Has anyone else found this to be true? Any interesting workarounds so that they both behave the same?

+5
source share
4 answers

I agree with Pat. At this point in the game, writing your own code to deal with cross-browser compatibility, given that the available Javascript frameworks do not make much sense. There are frameworks for almost every taste (some are really quite tiny), and they are focused on really abstracting from all the differences between browsers. They do more tests than you probably do.

Something like jQuery or Yahoo YUI (think of how many people got into Yahoo Javascript in a day and the variety of browsers) just tested more expensive than any piece that you or I came up with.

+9
source

I am using jQuery . html () to get consistent results in browsers.

+11
source

- , jquery - , , - , , , jquery , .

+2

$( "thisid" ) document.getElementById( "thisid" ) . .

+1

All Articles