jQuery (events and layout) not working in PhoneGap (Android) app -
the events (transition, click, load, alert) of app (jquery mobile) works on browser, not when build android using phonegap.
- note 1. in browser, click, , redirects page, shows alerts, draw layout, views, ... in emulator nothing works.
- note 2. think important doing right reference scripts. since works on browsers, supposed it's good.
this how looks on browsers:

this how looks on emulator:

this directory:

and here code: /www/index.html:
<!doctype html> <html> <head> <title>tittle</title> <script src="phonegap.js"></script> <script> window.location='app/index.html'; </script> <body> </body> </html> /www/app/index.html:
<div data-role="page" id="login-page" > <div data-role="main" class="ui-content"> <form id="check-user" class="ui-body ui-body-a ui-corner-all" data-ajax="false"> <fieldset> <div data-role="fieldcontain"> <label for="user_email">enter username:</label> <input type="text" value="" name="user_email" id="user_email"/> </div> <div data-role="fieldcontain"> <label for="user_password">enter password:</label> <input type="password" value="" name="user_password" id="user_password"/> </div> <a href="" > <input type="button" name="submit" id="submit" value="submit"></a> </fieldset> </form> </div> </div> </body> </html> /www/app/js/global.js:
$(document).on('pageinit', '#login-page', function(){ $(document).on('vclick', '#submit', function() { alert(' hi......!'); });
Comments
Post a Comment