简体   繁体   中英

cordova.js not working on remote page

I'm very new in phonegap and i'm working on simple remote index.php file. When i use the example code below in local index.html, it works. But when i use it on remote page, it's not working. i have the latest phonegap 2.9.0. Is there anything that i'm missing? thanks.

// Code

<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript">
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
  alert("just work!");
}
</script>

You have to load cordova.js locally, so you can't use a remote index.html

Source: http://community.phonegap.com/nitobi/topics/phonegap_functions_from_external_website

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM