我遇到cordova导航警报问题。在deviceReady
事件被触发后,我调用了导航器警报方法。我无法弄清楚它为什么不开火。
请检查下面的代码,让我知道如何解决它。
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="cordova_plugins.js"></script>
<script type="text/javascript" >
window.onload = function(){
document.addEventListener("deviceready", onDeviceReady, false);
}
function onDeviceReady() {
// Register the event listeners
alert("Start !");
navigator.notification.alert('Game Over!',gameOverDismissed,'Game Over','Done');
}
function gameOverDismissed(){
}
</script>
config.xml中
<name>hello</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<feature name="App">
<param name="android-package" value="org.apache.cordova.App" />
</feature>
<feature name="Vibration">
<param name="android-package" value="org.apache.cordova.vibration.Vibration" />
</feature>
<feature name="Notification">
<param name="android-package" value="org.apache.cordova.dialogs.Notification" />
</feature>
<access origin="*" />