慕无忌1623718
基于上面的例子,这是它对我有用的方式<!DOCTYPE html><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="format-detection" content="telephone=no" /> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> <link rel="stylesheet" type="text/css" href="css/bootstrap.css" /> <title>InforMEA</title> </head> <body> <script type="text/javascript" src="js/jquery-1.8.3.js"></script> <script type="text/javascript"> var dd = $.Deferred(); var jqd = $.Deferred(); $.when(dd, jqd).done(doInit); $(document).bind('mobileinit', function () { jqd.resolve(); }); </script> <script type="text/javascript" src="js/jquery.mobile-1.2.0.js"></script> <script type="text/javascript" src="cordova-2.2.0.js"></script> <script type="text/javascript"> document.addEventListener('deviceready', deviceReady, false); function deviceReady() { dd.resolve(); } function doInit() { alert('Ready'); } </script> </body></html>