Tuesday, 15 September 2015

cordova - phonegap device ready not fired when site redirects -



cordova - phonegap device ready not fired when site redirects -

i need help , below scenario ,

i going convert mobile site in mobile app decide utilize phonegap.

from index.html redirect mobile site domain using meta tag ex: <meta http-equiv="refresh" content='2;url=http://m.test.com/testapp.jsp'>

it works fine . need additional functionality track button ,notification,contact list that's why need device ready function not firing in above scenario

please provide me suggestion how can phone call device ready function server side jsp or new idea.

below illustration .

<!doctype html> <html> <head> <meta http-equiv="refresh" content='2;url=http://m.test.com/testapp.jsp'> <script src="js/cordova-2.7.0.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript" charset="utf-8"> document.addeventlistener("deviceready", ondeviceready, false); function ondeviceready() { alert("test"); } </script> </head>

forget meta tag. set code within ondeviceready function:

function ondeviceready() { //alert("test"); document.location = "http://m.test.com/testapp.jsp"; }

but perhaps approach not best, improve single page application

cordova

No comments:

Post a Comment