Compatibility problem testing and solutions

Source: Internet
Author: User

Front-end the most difficult is the browser compatibility problem, the problem is mainly: obviously is a right thing, in front of different browsers, style above become a variety of, then you have to go from the correct code inside to find the so-called "error" can be so irresponsible to say, The cause of the error is not in ourselves, but in the differences of the browsers, however, these differences are not solved by our tiny power, so to solve the compatibility problem has become a potential task for us.

The nature of the compatibility problem I think it should be the browser in the design of the time did not follow the same specifications, the set of specifications and which browsers are fully follow, are the characteristics of each, and secondly, in the core of the different trident,webkit,chrome, etc., these are just the core of the mainstream browser, For example, IE9 the following browsers in the new specifications and properties do not very good, the problem is the largest, and then Firefox, relatively independent, and some things have to be deliberately set to him, and finally Google, compared to the previous two in compatibility should be the best, But the point is: We can't allow users to choose a browser!

For example, the following piece of code, open the comment, then let me very depressed, do not start, the code without any errors.

<body class= "Empmanage_body" ><div class= "empmanage_div_1" >

External CSS files:

. Empmanage_body{background-color: #507FD2;/*background-image:url (.. /picture/center.jpg) background-size:200px 350px;/* background size *//*background-position:566px  158px;/* background position *//* background-repeat:no-repeat;*/}.empmanage_h1{margin-left:150px;}. empmanage_div_1{margin-left:420px;width:500px;height:500px;background:red;}. Empmanage_table_1{postion:relative;margin-left:180px;margin-top:80px;width:150px;height:300px;font-family: Official script; font-size:33px;}. Empmanage_a_1{color:black;}. Empmanage_a_2{color:black;}. Empmanage_a_3{color:black;}. Empmanage_a_4{color:black;}



The scenarios for resolving compatibility issues are as follows:

1: At the beginning of the design, as far as possible with the traditional code to solve, do not recommend the use of newer properties and specifications.

2: For different browsers, the corresponding error and exception handling.

3: In the design of the code, the mainstream of the browser to complete the test, especially Ie,ie no problem, basically the other is no problem.

4: The best side to write, while testing, otherwise, the code is large, it is difficult to find the problem.


Compatibility problem testing and solutions

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.