javascript - Code not working on Phonegap Application -
currently working on phonegap , have found sample code want make work phonegap could't . 1 more thing want mention here jquery mobile 1.2.0 used want use jquery mobile 1.3.2 , jquery 2.1.1 ,cordova-3.4.0
any apreciated .thanks in advance .
<!doctype html> <html> <head> <title>jqm complex demo</title> <meta name="viewport" content="initial-scale=1, maximum-scale=1"/> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" /> <style> #content { padding: 0; position : absolute !important; top : 40px !important; right : 0; bottom : 40px !important; left : 0 !important; } </style> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script> <script> $(document).on('pageinit', '#index',function(e,data){ var minzoomlevel = 12; var map = new google.maps.map(document.getelementbyid('map_canvas'), { zoom: minzoomlevel, center: new google.maps.latlng(38.50, -90.50), maptypeid: google.maps.maptypeid.roadmap }); }); </script> </head> <body> <div data-role="page" id="index"> <div data-theme="a" data-role="header"> <h3> first page </h3> </div> <div data-role="content" id="content"> <div id="map_canvas" style="height:100%"></div> </div> <div data-theme="a" data-role="footer" data-position="fixed"> <h3> first page </h3> </div> </div> </body> </html>
reason code not working missing jquery library. jquery mobile can't work without jquery.
that's why you're receiving error:
"uncaught typeerror: cannot read property 'mobile' of undefined", source: code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js (2) , on android device screen getting "first page" 2 times in vertical order there no map .
Comments
Post a Comment