iPhone window.open(url,'_ blank')无法在移动版Safari中打开链接 [英] iPhone window.open(url, '_blank') does not open links in mobile Safari

查看:123
本文介绍了iPhone window.open(url,'_ blank')无法在移动版Safari中打开链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将用户发送到iPhone / iPad上的独立网络应用程序(保存到主页,没有PhoneGap)中的某些.pdf文件。使用 window.open(url,'_ blank'); 这些文档在Web应用程序之上打开,因为没有后退按钮,所以无法返回。我可以在JavaScript的新窗口中打开它们,还是只需要使用真正的 a href

I'm sending users to some .pdfs in a standalone web app (saved to home page, no PhoneGap) on iPhone/iPad. With window.open(url, '_blank'); these documents open on top of the web app and since there is no back button there is no way to get back. Can I open these in a new window in JavaScript, or do I just need to use a real a href?

推荐答案

您也可以使用内联弹出窗口,而不是使用window.open。为此,您可以编写自己的代码或参考: JQuery Dialog

Instead of using window.open you also can use inline pop-ups. For that, You can write your own code or refer this: JQuery Dialog

但是使用标准的window.open javascript函数,几乎不可能在某些浏览器中隐藏地址栏(如Internet Explorer)

However using standard window.open javascript function, Its almost impossible to hide the address bar in some browsers (like Internet explorer)

内联(我的意思是html)对话框比window.open有更多的功能。

Inline (I mean html) dialogs have more features than window.open.

希望它有所帮助。

这篇关于iPhone window.open(url,'_ blank')无法在移动版Safari中打开链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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