Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/444.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Cordova/Phonegap 3.3中的外部链接/InAppBrowser的行为始终类似于_“自我”;_Javascript_Ios_Cordova - Fatal编程技术网

Javascript Cordova/Phonegap 3.3中的外部链接/InAppBrowser的行为始终类似于_“自我”;

Javascript Cordova/Phonegap 3.3中的外部链接/InAppBrowser的行为始终类似于_“自我”;,javascript,ios,cordova,Javascript,Ios,Cordova,我正在尝试在Phonegap应用程序中创建链接,这些链接在应用浏览器中的“可关闭”中打开,或者至少在外部Safari事件中打开,而不是在Webview本身中打开 使用_blank或_system总是会导致一个“_self”beahviour(页面在Webview中打开) 我正在尝试一个全新的Phonegap项目,目标是iOs。模拟器和设备上都存在相同的问题 iApp浏览器已正确安装: $ cordova plugins ls [ 'org.apache.cordova.inappbrowser'

我正在尝试在Phonegap应用程序中创建链接,这些链接在应用浏览器中的“可关闭”中打开,或者至少在外部Safari事件中打开,而不是在Webview本身中打开

使用_blank或_system总是会导致一个“_self”beahviour(页面在Webview中打开)

我正在尝试一个全新的Phonegap项目,目标是iOs。模拟器和设备上都存在相同的问题

iApp浏览器已正确安装:

$ cordova plugins ls
[ 'org.apache.cordova.inappbrowser' ]
project.xml没有什么特别之处:

<?xml version='1.0' encoding='utf-8'?>
<widget id="me.nerik.superpo" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
    <name>Test</name>
    <description>
        Hello World sample application that responds to the deviceready event.
    </description>
    <author email="support@phonegap.com" href="http://phonegap.com">
        PhoneGap Team
    </author>
    <feature name="http://api.phonegap.com/1.0/device" />
    <preference name="permissions" value="none" />
    <preference name="orientation" value="default" />
    <preference name="target-device" value="universal" />
    <preference name="fullscreen" value="true" />
    <preference name="webviewbounce" value="true" />
    <preference name="prerendered-icon" value="true" />
    <preference name="stay-in-webview" value="false" />
    <preference name="ios-statusbarstyle" value="black-opaque" />
    <preference name="detect-data-types" value="true" />
    <preference name="exit-on-suspend" value="true" />
    <preference name="show-splash-screen-spinner" value="true" />
    <preference name="auto-hide-splash-screen" value="true" />
    <preference name="disable-cursor" value="false" />

    <icon src="icon.png" />
    <icon gap:platform="ios" height="57" src="res/icon/ios/icon-57.png" width="57" />
    <icon gap:platform="ios" height="72" src="res/icon/ios/icon-72.png" width="72" />
    <icon gap:platform="ios" height="114" src="res/icon/ios/icon-57-2x.png" width="114" />
    <icon gap:platform="ios" height="144" src="res/icon/ios/icon-72-2x.png" width="144" />
    <gap:splash gap:platform="ios" height="480" src="res/screen/ios/screen-iphone-portrait.png" width="320" />
    <gap:splash gap:platform="ios" height="960" src="res/screen/ios/screen-iphone-portrait-2x.png" width="640" />
    <gap:splash gap:platform="ios" height="1024" src="res/screen/ios/screen-ipad-portrait.png" width="768" />
    <gap:splash gap:platform="ios" height="768" src="res/screen/ios/screen-ipad-landscape.png" width="1024" />

    <access origin="*" />

    <feature name="InAppBrowser">
        <param name="ios-package" value="CDVInAppBrowser" />
    </feature>

</widget>

碰巧我不是在等《恶魔日报》的开播。 在某个时候,我(愚蠢地)注释掉了等待事件启动应用程序的部分,因为“deviceready”不再启动。
我不得不用cordova.js替换phonegap.js。我不知道确切的原因:(

尽管您可能已经找到了与应用程序初始化代码相关的解决方案,但您的错误听起来很像我报告的错误,从CLI添加插件基本上无法生成正确的cordova_plugins.js文件。您可以将自己的答案标记为“正确”,所以这个问题似乎不再公开。
var app = {
// Application Constructor
initialize: function() {
     document.querySelector("h1").onclick = function()
    {
        console.log("clicked !");
        // var ref = window.open( "http://google.com", '_blank', 'location=yes');
        var ref = window.open( "http://nerik.me", '_system');
    };

}
};