PhoneGap构建

编程入门 行业动态 更新时间:2024-10-14 08:27:43
本文介绍了PhoneGap构建-navigator.notification.alert在WP7模拟器中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我用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构建

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

发布评论

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

>www.elefans.com

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