JSIE and FF compatibility problem summary _ javascript skills
Source: Internet
Author: User
Here we will replace InternetExplorer with IE, and replace MozzilaFF with MF. We will summarize some of the knowledge that js fans will learn.
1. document. form. item Problems Existing problems:
Many statements such as document. formName. item ("itemName") exist in the existing code and cannot be run in MF.
Solution:
Use document. formName. elements ["elementName"]
Others
See 2
2. Collection class Object Problems Existing problems:
In the existing Code, many collection class objects are used (), which is acceptable to IE and cannot be used by MF.
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. window. event Existing problems:
Window. event cannot be run on MF.
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 ):
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.