navigator.notification.alert()不是在科尔多瓦

编程入门 行业动态 更新时间:2024-10-14 10:38:54
本文介绍了navigator.notification.alert()不是在科尔多瓦 - 2.0.0.js工作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是新来phonegap.In我的申请,我想显示alerts.For,我已经使用以下code,

I am new to phonegap.In my application i want display alerts.For that i have used following code,

navigator.notification.alert("PhoneGap is working");

但它不是working.My HTML总额code是,

But it is not working.My total html code is,

<html> <head> <script type="text/javascript" charset="utf-8" src="js/cordova-2.0.0.js"></script> <script> function inti() { alert("inti"); document.addEventListener("deviceready", onDeviceReady, true); } function onDeviceReady() { alert("on device ready!!!!"); navigator.notification.alert("PhoneGap is working"); } </script> </head> <body onload="inti()"> <p id="demo">System date</p> <input type="button" onclick="noti()" value="Date" /> </body> </html>

我得到不能调用方法'警惕'的不确定我得到这个错误。可任何一个指导我到超过走到这一步的问题。在此先感谢.....

i got Cannot call method 'alert' of undefined i got this error .can any one guide me to over come this issues. Thanks in Advance .....

推荐答案

您忘了加上cordova.js。尝试添加这一点。

You forgot to add the cordova.js . Try to add this.

&LT;脚本类型=文/ JavaScript的字符集=utf-8SRC =JS /科尔多瓦,2.0.0.js&GT;&LT; / SCRIPT&GT;

也添加

document.addEventListener(deviceready,onDeviceReady,真实); 上方 onDeviceReady()函数

更多推荐

navigator.notification.alert()不是在科尔多瓦

本文发布于:2023-11-27 19:53:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639380.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:是在   科尔   多瓦   navigator   notification

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!