xcode Phonegap App : 外部 URL 不会在 IOS 的 InApp 浏览器中打开
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17569787/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Phonegap App : External URL don't open in InApp Browser of IOS
提问by Shashi
External URLs don't open in the system's browser in my PhoneGap IOS application. I'm using PhoneGap Build 2.7.0.
外部 URL 不会在我的 PhoneGap IOS 应用程序的系统浏览器中打开。我正在使用 PhoneGap Build 2.7.0。
Javascript:
Javascript:
window.open(myURL, '_blank', 'location=yes');
window.open(myURL, '_blank', 'location=yes');
Config.xml
配置文件
<plugins>
<plugin name="InAppBrowser" value="CDVInAppBrowser" />
</plugins>
<access origin="*" />
How to solve this? when i using the url "www.google.com" it works fine but when i used required url for my app it did not worked even that url works fine in browser.
如何解决这个问题?当我使用网址“www.google.com”时,它工作正常,但是当我为我的应用程序使用所需的网址时,即使该网址在浏览器中工作正常,它也无法正常工作。
回答by Shashi
Javascript:
Javascript:
myURL = encodeURI(myURL);
window.open(myURL, '_blank', 'location=yes');
Using of encodeURI method fix the above issue
使用 encodeURI 方法解决上述问题

