我已经安装了cordova 的diaglog 插件。当我运行它时,我收到一条错误消息“无法调用未定义的方法‘警报’”。
当我从控制台执行相同的函数时,它运行完美。
这是我的index.html 文件:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript" src="plugins/org.apache.cordova.dialogs/www/notification.js"></script>
<script type="text/javascript">
$( document ).ready(function() {
navigator.notification.alert( <--------------------- here!!
'You are the winner!', // message
function(){
}, // callback
'Game Over', // title
'Done' // buttonName
);
});
</script>
<LINK rel="stylesheet" href="style.css" type="text/css">
</head>
<body >
<div> hello world</div>
</body>
</html>
最佳答案
关于javascript - 除了从控制台 : cannot execute 'alert' of undefined 之外,插件未运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24024835/