The compatibility between IE and Firefox in Javascript is compiled below to replace Internet Explorer with IE and replace Mozzila Firefox with MF
1. document. form. item problems
(1) existing problems:
Many statements such as document. formName. item ("itemName") exist in the existing code and cannot be run in MF.
(2) solution:
Use document. formName. elements ["elementName"]
(3) Others
See 2
2. collection class object problems
(1) existing problems:
In the existing code, many collection class objects are used (), which is acceptable to IE and cannot be used by MF.
(2) solution:
Use [] as the subscript operation. For example, change document. forms ("formName") to document. forms ["formName"].
For example, change document. getElementsByName ("inputName") (1) to document. getElementsByName ("inputName") [1]
(3) Others
3. window. event
(1) existing problems:
Window. event cannot be run on MF.
(2) solution:
MF events can only be used in the event. this problem cannot be solved. This can be changed as follows:
Original Code (can be run in IE ):
...