"Javascript" IE8 compatibility issues Summary

Source: Internet
Author: User

This chapter is a summary of the IE8 compatibility issues encountered during Web page development.

It's too much of a hole, repeatedly stepping on the pit, always have no memory. And the more pit is IE8 developer tool is too difficult to use, want to debug all debug not come out.

Had to record down, the next problem is good for easy troubleshooting.

JS script, you must follow the following rules, otherwise all will cause JS script in IE8 error.

1. After the statement of all JS scripts is finished, you must end with a semicolon.

2. When declaring or assigning arrays (array) objects, be aware that you cannot have extra commas (,) such as:

var arrnum = [1,2,4,];var arrstr = [    {key:1},    {key:2},];

3.json Object declaration or assignment, also cannot have extra comma (,), such as:

var jsonobj = {     key: "111",     Value: "222222",};

4. When the event is bound, it is best to use jquery for binding instead of using the OnClick event directly. The reasons for this need to be investigated. Such as:

-------------recommended Way-----------------------<div class= ' button ' ></div><script>        $ (". Button"). Click (function () {        alert (1111111);    }); </script>---------------Not recommended--------------------<div class= ' button ' onclick= ' alert (3333333); ' ></div>



"Javascript" IE8 compatibility issues Summary

Related Article

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.