【问题标题】:Windows Phone 8: Open Link in new TabWindows Phone 8:在新选项卡中打开链接
【发布时间】:2013-06-10 10:37:09
【问题描述】:

我尝试通过多种方式实现这一目标,但都不起作用:

<a href="url" target="_blank"/>

<a href="javascript:void(0)" onclick="window.open(url)"/>

<a href="javascript:void(0)" onclick="window.open(url,'_blank')"/>

<a href="javascript:void(0)" onclick="window.open(url,'_newtab')"/>

<a href="javascript:void(0)" onclick="window.open(url,'popup','width=640,height=480')"/>

我读到 here 说这无法在 windows phone 7 上以编程方式控制,但是我需要 windows phone 8 的解决方案。

非常感谢任何帮助。

【问题讨论】:

    标签: javascript html css mobile windows-phone-8


    【解决方案1】:

    Internet Explorer 10 与 Windows 8 和 Internet Explorer 10 for Windows Phone,您需要 意识到。适用于 Windows Phone 的 Internet Explorer 10 不支持 以下:

    • 通过脚本进行跨标签通信(因此 window.open 在同一标签中打开目标 URL)
    • 同样在适用于 Windows Phone 的 Internet Explorer 10 中,Window.open 不会返回有效的窗口对象。这是因为在电话上每个 “窗口”被隔离在自己的沙箱中。

    引用http://blogs.windows.com/windows_phone/b/wpdev/archive/2012/11/08/internet-explorer-10-brings-html5-to-windows-phone-8-in-a-big-way.aspx - 打开链接查看完整列表。

    【讨论】:

    • 是否有一种解决方法来验证是否可以打开新窗口,如果不能打开则可以使用后备方法?
    【解决方案2】:

    在试图找到这个问题的答案时,我偶然发现了一个已在 StackExchange 上回答的问题。我拥有一部 Windows Phone,但我对这个答案感到有些难过。

    How to open a new window or tab via javascript in windows phone 7 browser

    注意:我知道这个问题是关于 Windows Phone 8 的,答案是指 Windows Phone 7,但我相信答案是一样的。

    【讨论】:

      猜你喜欢
      • 2012-04-25
      • 1970-01-01
      • 1970-01-01
      • 2015-11-28
      • 2012-05-03
      • 2014-06-24
      • 2015-07-24
      • 2018-11-22
      • 1970-01-01
      相关资源
      最近更新 更多