JavaScript cross-browser compatibility test in three steps

Source: Internet
Author: User

Different browsers have different compatibility with JavaScript. Especially between IE and other browsers. Even different versions of IE may be different. There are three solutions:

BKJIA recommended reading: Javascript solves Common Browser compatibility problems

◆ Check the browser name and version and write different codes

◆ Write JavaScript-compliant code and run it on a browser that supports this standard

◆ Use JavaScript frameworks like jQuery that are compatible with processing

The second type is not realistic at present, because IE6 has a large market share, while IE7, IE8, Firefox and other browsers occupy a considerable market share, compatibility issues cannot be completely solved by standards, but can only be viewed in the future. browser developers consciously follow international standards.

The third is actually a roundabout way to hand over compatibility to third-party developers. Many small and medium-sized enterprises will choose this approach, and even some large enterprises will use this framework, such as Google. However, in some cases, you may not want to use the framework, maybe because the application is very simple. You do not want to use the same heavy framework, or maybe it is another reason. In this case, you must consider the compatibility issues yourself.

First, it is the most common practice, but there are flaws, that is, there are some situations where it is not accurate to determine the type version number of the browser. For example, other browsers using the IE kernel, such as roaming. In this case, you can choose whether the browser running the current Code supports the JavaScript feature you are using. Someone specially wrote the test code and provided it for free. Below is the link:

Test of basic features: http://yura.thinkweb2.com/cft/

Styles Support Test: http://yura.thinkweb2.com/cft/style.html

Event Support Test: http://yura.thinkweb2.com/isEventSupported/

The site is in English, but you can view the features in the table to know the test project.

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.