PhoneGap构建-navigator.notification.alert在WP7模拟器中不起作用 [英] PhoneGap Build - navigator.notification.alert not working in WP7 emulator

查看:76
本文介绍了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!");
    }

源代码 https://github.com/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构建-navigator.notification.alert在WP7模拟器中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆