target = _blank不工作在iphone [英] target= _blank not working in iphone

查看:161
本文介绍了target = _blank不工作在iphone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建立一个 phonegap 申请,该申请必须显示外部条款&条件页面,如果用户点击应用程序中的T& C链接。此页面必须在新窗口中打开,用户应该能够在访问此页面后返回到应用程序。我的应用程式可在 Android Blackberry 装置中正常运作。但在 iPhone 中,条件页面在同一窗口中打开,用户无法导航回到应用程序。如果用户关闭应用程序(通过按中心按钮)并再次打开它,相同的条件页面,并且用户无法继续到下一页。请找到下面的代码段。

I am building a phonegap application which has to display an external terms & conditions page if the user clicks on the T&C link in the app. This page has to be opened in a new window and the user should be able to navigate back to the app after visiting this page. My application works fine in Android and Blackberry devices. But in iPhone the 'terms & conditions' page opens in the same window and the user is not able to navigate back to the app. If the user closes the app(by pressing the centre button) and open it again, the same 'terms & conditions' page is displayed and the user is unable to proceed to the next page. Please find the code snippet below.

<a href="t&c url here" id="tc_url" target="_blank">

请提出建议。

推荐答案

您可以在InAppBrowser中打开您的网页,使用此页。

You can open your page in InAppBrowser, use this .

var ref = window.open(url, 'random_string', 'location=no');

ref.addEventListener('loadstart', function(event) {

});
ref.addEventListener('loadstop', function(event) {
     console.log(event.type + ' - ' + event.url);

});
ref.addEventListener('exit', function(event) {

});

这篇关于target = _blank不工作在iphone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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