html5 - Prevent jQuery Mobile Page navigation (PhoneGap) IF -
using phonegap...
i find way prevent navigation data-role='page', if user has no network connection. i'm having hard time finding resources this, few hours deep on google searching, although using wrong terms.
i want user able navigate here if there network connection:
<div data-role="page" id="location"> <div data-role="header" data-theme="e"> <a href="#" data-rel="back">incid..</a> <h1> location</h1> <a href="#" data-rel="back" onclick="updateloc()" data-theme="g">use current</a> </div> <!-- /header --> <div data-role="content"> <!--<div id="panel"> <input id="target" type="text" placeholder="search box"> </div>--> <div id="map_canvas"> </div> </div>
using jquery pageshow
:
$('#location').live('pageshow', function (event, ui) { try { display(); } catch (e) { log(e); alert(e); } });
i know should able catch network status using if(navigator.network.connection.type == 'none'), i'm having difficulty stopping location page showing.
use $.mobile.changepage('#pageid')
change page depending on if user has network connection or not.
Comments
Post a Comment