Sunday, 15 February 2015

javascript - page create phonegap jquery mobile -



javascript - page create phonegap jquery mobile -

i trying execute script when page loaded didn't works

to begin load first page with

$('#loadingpage').bind('pageinit', function(event) {...}

this works redirect page menu.html

<!doctype html> <html> <head></head> <body> <div date-role="page" id="menupage"></page> </body> </html>

in script file have

$('#menupage').live('pageshow', function(event) {alert('bbb')}; $('#menupage').live('click', function(event) {alert('aaa')};

i never have alert bbb when click on screen have alert aaa

the total script code:

http://pastebin.com/jh676yfz

thanks

you had 2 problems in code. pagecreate should not used page load trigger, improve utilize pagebeforechange , pageshow. first problem. sec 1 error in menu.html page formatting, fixed now.

one more thing, not error have changed live( on( function event binding. not problem, live deprecated , think wont work more jquery 1.9

javascript cordova jquery-mobile

No comments:

Post a Comment