navigator.notification。* failed“navigator.notification [undefined] is not an object”。

编程入门 行业动态 更新时间:2024-10-13 12:23:28
本文介绍了navigator.notification。* failed“navigator.notification [undefined] is not an object”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

对PhoneGap navigator.notification方法的任何调用都失败,并显示消息表达式结果navigator.notification [undefined]不是对象

Any call to a PhoneGap navigator.notification method is failing with the message "Result of expression navigator.notification [undefined] is not an object"

我已经完成了这里概述的完整安装和项目生成过程: phonegap.pbworks/Getting-started-with-Android-PhoneGap-inEclipse

I've gone through the full installation and project generation process outlined here: phonegap.pbworks/Getting-started-with-Android-PhoneGap-in-Eclipse

...并且从Eclipse运行时应用程序运行正常,除非尝试访问导航器对象。以下是抛出错误的JavaScript代码:

...and the application works fine when run from Eclipse, except until trying to access the navigator object. Here is the JavaScript code that is throwing the error:

var beep = function() { try { if (navigator != null) { navigator.notification.beep(2); } } catch (e) { alert("Beep failed: " + e.message); } }

推荐答案

I认为cordova * .js

I think the cordova*.js

(src =cordova-2.1.0.js)与您项目的www文件夹中的不同。我有同样的问题&更改Index.html页面中的引用解决了我的问题。

(src="cordova-2.1.0.js") is not same as in the www folder of your project. I had this same problem & changing the reference in Index.html page solved my problem.

请参阅此链接: phonegap-sample-application-for-android-does-not-work

更多推荐

navigator.notification。* failed“navigator.notification [undefined] is not an obj

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

发布评论

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

>www.elefans.com

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