Summary of web page and browser compatibility issues (draft1)_javascript skills
- WBOYOriginal
- 2016-05-16 18:52:08960browse
1. Javascript
1. The getYear method of date object
The result returned by IE getYear() is the same as the result of getFullYear(), but ECMA262 clearly stipulates that getYear returns "year- 1970". Some websites use getYear to return the year, which results in logical differences between relatively standardized browsers such as IE and FF.
2.DOM
1. Event model
2.document.elementFromPoint
This method of document is an IE extension and can return the element based on the client area coordinates of the viewport. DOM node. Safari also supports this method, but the coordinates represent the coordinates after the web page content is laid out (the coordinates are the coordinates of the client area of the browser window). The difference between the two means that if you want to get the element node through the position of the mouse pointer, IE can directly return the element to the client area coordinates (clientX, clientY) of the event, but Safari needs to use scrollX and scrollY to return it. Both are reasonable in the sense of this interface. The meaning of this coordinate is not clearly defined in MSDN, but IE is simpler in terms of interface usage, while Safari requires coordinate conversion.
3.CSS
4.layout
5. Plug-in and ActiveX
As we all know, IE is compatible with third-party programs. It is ActiveX technology; while Firefox, Safari, Chrome, and Opera use NPAPI plug-in technology. In terms of interface level, the plug-in interface level of the two is lower (both are C function pointers). They use abstract interfaces and data types to encapsulate the interaction logic between the browser and third-party programs, but the browser and plug-in programs are tightly coupled; ActiveX shields the process and thread models and is a loosely coupled interaction method. This is why legal ActiveX will not crash IE in IE, but plug-ins with the same function may crash the browser. The difference in this feature is also one of the bigger differences in browser compatibility.
6. Others
1. The forum sets cookies based on the browser sub-version in UserAgent. This is not reasonable because UserAgent will change with the browser version, causing the original cookie to be effective. .
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn