Cause Analysis and Solution for external JS not loaded after jQueryMobile page Jump _ jquery

Source: Internet
Author: User
The JS referenced in pageB does not run successfully when Web development performs page Jump. This article provides a detailed solution to this problem. If you are interested, refer to the following, we hope this will help you use jQuery Mobile for Web development. When the page jumps (pageA => pageB), The JS referenced in pageB does not run successfully. Because JQM only adds the data-role = "page" element to the current dom to load the entire page to the current dom.

Therefore, the external JS files introduced in, and JS outside the tag cannot run normally. The page can be loaded successfully after the page is refreshed.

Considering that the JQM feature is unlikely to be changed proactively, Two solutions are available.:
First, register all external JS files to be used on the index page, or use the master page for unification;
The second is to write the internal JavaScript code on the page under the data-role = "page" label, so that no matter how the page jumps, it can run.

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.