Recently in a project, using jquery Mobile, very unfamiliar to him, the problem of one after another, it is necessary to solve, find a day this problem, put can understand:
First understand JQM inside page jump by default is through the AJAX request, must re-refresh the page JS square can be effective, that is, JS does not work, not JS itself problem, the following talk about the solution:
when using JQuery Mobile for Web development, when the page jumps (PageA = PageB), the JS referenced in PageB does not run successfully. Because, JQM and loading the entire page into the current DOM, only the data-role= "page" element is added to the current DOM.
Therefore, the introduction of the external JS file in New Page The rear can be loaded successfully.
Given that the JQM feature is unlikely to be actively changed, There are two ways to solve :
first, in the index page, register all the required to the external JS file, or use the master page to unify;
Second, the page internal JS written in the data-role= "page" tag, so no matter how the page jumps, can be run.
How, solve it,!! @