我用PGB构建了这个简单的代码,但是在WP7仿真器中不起作用-没有警报消息. 对于android模拟器来说还可以. 怎么了?
I build this simple code with PGB, but it does not working in WP7 emulator - no alert message. For android emulator its ok. What's wrong?
document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { navigator.notification.alert("Device Ready!"); }源代码 github/dprotopopov/pgb-wp7-alert
推荐答案这似乎是针对WP7的最新PhoneGap构建的错误.我已经在Visual Studio中启动并运行了该程序,尽管可以在代码中访问navigator对象,但是没有可用的通知属性.您可以通过遍历应用程序中导航器对象的属性来自己进行测试;
This seems to be a bug with the latest PhoneGap build for WP7. I have this up and running in Visual Studio and although the navigator object is accessible in the code there is no notification property available. You can test the same yourself by iterating through the properties of the navigator object in your app;
for(var key in navigator){ document.write(key + "<br>"); }我得到的列表如下,请注意,通知不是其中之一:(
The list I get is as follows, note that notification is not one of them :(
- appCodeName
- appMinorVersion
- 浏览器语言
- cookieEnabled
- cpuClass
- mimeTypes
- 插件
- systemLanguage
- userLanguage
- msDoNotTrack
- 地理位置
- appName
- appVersion
- 平台
- userAgent
- 在线
- javaEnabled
- taintEnabled
- appCodeName
- appMinorVersion
- browserLanguage
- cookieEnabled
- cpuClass
- mimeTypes
- plugins
- systemLanguage
- userLanguage
- msDoNotTrack
- geolocation
- appName
- appVersion
- platform
- userAgent
- onLine
- javaEnabled
- taintEnabled
更多推荐
PhoneGap构建
发布评论