【发布时间】:2013-05-30 12:05:51
【问题描述】:
我有一个简单的 jQuery Mobile 应用程序,基本上只有 2 个页面。
第一页只有一个按钮:
<a href="location.html" data-theme="b" data-role="button" data-icon="arrow-r">Create Report</a>
当点击按钮时,我导航到location.html,这个页面有它自己的 JS 文件,里面有以下内容:
(function( $, undefined ) {
$( document ).on( "pageshow", function(){
initMap();
});
})( jQuery );
但是,当我到达页面时,不会调用 JS 函数 initMap();,如果我刷新页面,则会调用该函数,但在我使用主页上的按钮导航时不会调用该函数。
如何确保每次导航到此页面时都会调用此函数?
【问题讨论】:
标签: jquery jquery-mobile