It seems that after transitioning to a new page, the javascript cannot be ran. Since most decent client apps now involve lots and lots of JavaScript, was is the general preferred 开发者_运维知识库pattern for Jquery mobile and using javascript within each page?
all JavaScript should be in the root page. so if index.html is your home page put all the JavaScript in that page
You can bind to the pageshow event and run jquery code depending on when the page is shown:
$(document).ready(function(){
$('div').live('pageshow', function () {
if(this.id=="months.html"){
//Page specific to a page div with "months.html" id
alert("The month.html page was just shown");
}
});
});
精彩评论