cordova - Phonegap : How to make every page load -
i building app in phonegap framework , want on each page need load upon call other function. let's have homepage menu. when user enter on 'page2' call page2_function(),on enter 'page3' call page3_function(); markup structure :
<div data-role="page" id="page1" data-theme="c"> <!-- header --> <div data-role="header" id="wrap-header"> <img src="img/logo.png" class="logo"/> <a href="page2" class="menu" data-transition="slide">page2</a> <a href="page3" class="menu" data-transition="slide">page3</a> </div> <!-- /header --> <!-- content --> <div data-role="content" id="content"> <ul data-role="listview" data-inset="true" data-theme="e" id="list_view"></ul> <h3>content</h3> <p> page1 </p> </div> <!-- /content --> <!-- footer --> <div data-role="footer"> <h4>© 2013 name</h4> </div> <!-- /footer --> </div> <!--page2--> <div data-role="page" id="page2" data-theme="c"> <!-- header --> <div data-role="header" id="wrap-header"> <img src="img/logo.png" class="logo"/> <a href="page2" class="menu" data-transition="slide">page2</a> <a href="page3" class="menu" data-transition="slide">page3</a> </div> <!-- /header --> <!-- content --> <div data-role="content" id="content"> <ul data-role="listview" data-inset="true" data-theme="e" id="list_view"></ul> <h3>content</h3> <p> page1 </p> </div> <!-- /content --> <!-- footer --> <div data-role="footer"> <h4>© 2013 name</h4> </div> <!-- /footer --> </div>
this may solve problem :
function page1_function() { location.reload(); //your code goes here ... }
Comments
Post a Comment