Solutions to several common problems with jQTouch

Source: Internet
Author: User

Recently, I was developing a website for the iPhone version and came into use with a jQuery plug-in called jQTouch. This plug-in is specifically designed for iPhone jQuery. However, many problems have been encountered during use, most of which are conflicts with the previous Javascript writing method, which are listed below for reference.

1. You need to use target = "_ webapp" for page Jump to jQTouch. Otherwise, a problem may occur.

2. Someone found a problem on the tap and click websites: I noticed an interesting bug with the JQTouch platform and wanted to know if anyone else has run into it our has a workaround for it. if I have a link with an onclick event and lightly tap the link on the iPhone, the link works, but the click event is not fired. if I tap the same link harder, the event fires. any thoughts on this? The solution is to use tap instead of click. The iOS series will generate a tap event when you touch the link, and a click event is triggered when you touch the link. Of course, you can use this statement to determine the system

Var userAgent = navigator. userAgent. toLowerCase (); var isiPhone = (userAgent. indexOf ('iphone ')! =-1 )? True: false; if (userAgent. indexOf ('ipod ')! =-1) isiPhone = false; // turn off taps for iPod Touches clickEvent = isiPhone? 'Tap': 'click'; $ ('# somelink'). bind (clickEvent, function (){...});

3. jQTouch is incompatible with Ajax. It divides multiple divs on the top layer into multiple pages for display and jumps by the div id. If you use Ajax to refresh the entire div, you will not be able to find the original div id during back. On the one hand, using back will cause errors, on the other hand, when redirecting to a div, the newly acquired page of Ajax will not be marked with class = "current", leading to overlapping display of several pages. It would be nice if the page to be jumped to is long, otherwise it would be a cup ...... If you encounter these problems temporarily, try again!

Source: http://kylinhuang.blog.163.com/blog/static/18259419620101166344177/

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.