navigator.app未定义 [英] navigator.app undefined

查看:322
本文介绍了navigator.app未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用:

navigator.app.loadUrl("http://www.google.com", { openExternal:true } );

它不适用于iOS,无论是在设备和模拟器。我在一个类似的项目中使用了相同的代码行,我使用相同版本的phonegap上(1.5.0)。在Android上,相同的代码工作完美。设备就绪功能也会触发,所以我猜是phonegap正在加载。我不使用android的phonegap.js文件,我已经检查过了。

And it does not work for iOS, either on device and simulator. I've used this same line of code in a similar project, and I'm using the same version of phonegap on both (1.5.0). On android the same code works perfectly. The device ready function also fires, so I'm guessing phonegap is being loaded. I'm not using the phonegap.js file of android, I've checked that.

在调试时,我发现 navigator.app 是一个未定义的对象。任何人都有任何想法的配置,我可能会失去导致这个?

While debugging I found that navigator.app is an undefined object. Does anybody have any idea of a configuration I might be missing to cause this?

感谢您的帮助。

Cheers,
Miguel

Cheers, Miguel

推荐答案

navigator.app对象仅适用于Android。幸运的是在即将发布的2.3.0版本的PhoneGap你将能够做到:

The "navigator.app" object is only available on Android. Luckily in the soon to be released 2.3.0 version of PhoneGap you will be able to do:

window.open("http://www.google.com", "_system");

做你想做的事。

这篇关于navigator.app未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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