[JavaScript] JS functions not implemented by iOS 5 Safari

Source: Internet
Author: User

Record the little things in Wireless Development

 

1. [Dom]. Click ()

The safari of ios5 is not implemented as an element. Click () method. If you develop it on a PC, it will cause an error when porting a project to a mobile device for testing. In particular, the popular web apps and single page apps are basically all generated by JS pages. Errors reported by IOS debugging tools do not report line numbers at all, so it is difficult to locate the problem.

Document. Click (); // an error is returned.

After testing, you can use Dom to create an event object and then activate click. Chrome on ios5 is no problem.

Ios6 repaired

* Alternative solution

1. Touchstart
2. Create an event object and manually trigger the click
3. Trigger method using the class library

 

2. [Dom] beforeunload

* Alternative solution

Unload

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.