문제

I am using the following code to changePage from First.html

$.mobile.changePage("Second.html", { transition: "slide" });

But this is neither calling document.ready on Second.js or pageshow or pagecreate events.

How do I call a method in Second.js after Second.html is loaded?

도움이 되었습니까?

해결책

I would guess your problem is related to placement of your Second.js file.

When loading intermediate pages, jQuery Mobile will strip whole page and load only BODY content. This is because jQuery Mobile uses AJAX for page handling. Only first (initial) page is fully loaded into the DOM. For other pages it is not necessary to load everything, no point if you already have whole page loaded into the DOM.

Read this article to find more about this problem. You will find several working solution.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top