jquery Mobile page Jump after JS does not execute the problem

Source: Internet
Author: User

To achieve a seamless customer experience on mobile devices, JQuery Mobile uses AJAX to load a destination link page by default. So when you click a link in a browser to hit a new page, JQuery Mobile receives the link, requests the link page in an AJAX way, and injects the requested content into the DOM of the current page. Also, you need to ensure that the requested page URL is uniquely identified.

The result is that user interaction is always saved on the same page. The contents of the new page are also easily displayed on this page. This smooth customer experience is much better than the traditional way to open a new page and wait a few seconds. When a new page is inserted into the main page as a new data-role= "page" Div, the main page will effectively cache the content that was taken. So that when you want to access a page can be displayed as soon as possible. The work process sounds incredibly complex, but most of us as developers don't need to know the specifics of the work. As long as you can see the effect is OK.

Workaround One:

If you want to run JavaScript while the page is loading, add data-ajax= "false" to the A tag

Workaround Two:

Use JS instead of connection jump <a href= "javascript:location.href ' register.aspx '" data-role= "button" data-inline= "true" Data-theme= "C" > Member registration </a>

Workaround Three:

Put the file you want to load in the Content tab: <div data-role= "Content" >
<script type= "Text/javascript" >
Alert (' OK now ');

jquery Mobile page Jump after JS does not execute the problem

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.