Web page and browser compatibility problem summary (draft1) _ javascript skills

Source: Internet
Author: User
Because IE has extended many private DOM and CSS, many web page developers develop according to IE, which leads to many non-standard Web pages, as a result, the current browser browsing the same web page has different effects. I. Javascript
1. The getYear method of the date object
The results returned by IE getYear () are the same as those returned by getFullYear (), but ECMA262 explicitly specifies that getYear returns "year-1970 ". Some websites use getYear to return the Year, which leads to logical differences between standard browsers such as IE and FF.
1. event model
2.doc ument. elementFromPoint
This method of document is extended by IE. The DOM node of the element can be returned according to the client Region coordinates of the viewport. Safari also supports this method, but the coordinates represent the coordinates after the webpage content layout (the coordinates are the client zone coordinates of the browser window ). The difference between the two results in that if you want to obtain the element node through the pointer of the mouse, IE is the client region coordinate (clientX, clientY) of the client that can directly event the returned element, however, safari uses scrollX and scrollY to return the result. In the sense of this interface, both are reasonable. The meaning of the coordinate is not clearly defined in MSDN, but IE is easier to use from the interface, while safari needs to convert the coordinates.
Iii. CSS
Iv. layout
V. Plug-ins and ActiveX
As we all know, IE is compatible with third-party programs using ActiveX technology, while Firefox, safari, Chrome, and opera adopt the plug-in Technology of NPAPI. At the interface level, the plug-in interface layers are lower (both are C function pointers), and abstract interfaces and data types are used to encapsulate the interaction logic between browsers and third-party programs, however, browsers and plug-ins are tightly coupled. ActiveX shields process and thread models and is a loosely coupled interaction method. This is also why the valid ActiveX does not cause IE to crash in IE, but the plug-in with the same function may cause the browser to crash. The difference in this feature is also one of the major differences in browser compatibility.
Vi. Miscellaneous
1. it is not reasonable for the forum to set cookies based on the sub-version of the browser in the UserAgent, because the original Cookie is effective as the browser version changes.

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.