Summary of Web Design issues: IE and firfox compatibility issues

Source: Internet
Author: User
Tags window

Web page Production WEBJX article introduction: Web Design Issues Summary: IE and Firfox compatibility issues.

IE and Firefox compatibility issues

1. Document.form.item question

(1) Existing problems:

There are many Document.formName.item ("itemname") statements in existing code that cannot be run under Firefox (Firefox)

(2) Solution:

Switch to document.formname.elements["ElementName"]

2. Collection Class object Problem

(1) Existing problems:

Many collection class objects in existing code use (), IE can accept, Firefox (Firefox) can not.

(2) Solution:

Use [] as the subscript operation instead. Such as:

Another example:

3. Window.event

(1) Existing problems:

Use window.event not to run on Firefox

(2) Solution:

Firefox event can only be used in the scene of the incident, this problem can not be resolved. You can do this:
Original code (can run in IE):

New code (can be run in IE and Firefox):

<input type= "button" Name= "Somebutton" value= "Submit" onclick= "Javascript:gotosubmit" (event)/><br BR/><script language= "javascript" ><br/>function gotosubmit (evt) {<br/>evt = evt? EVT: (Window.ev Ent? Window.event:null); <br/>...<br/>alert (EVT); Use evt<br/>...<br/>}<br/></script>

In addition, if the first line in the new code does not change, the same as the old code (that is, the gotosubmit call does not give the parameter), it still can only run in IE, but not error. Therefore, the TPL part of this scheme is still compatible with the old code.

[1] [2] [3] [4] [5] [6] [7] [8] Next page



Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.