Windows Phone 8:在新标签页中打开链接

5

我已经尝试了几种方法来实现这个目标,但都没有成功:

<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')"/>

我在这里读到,在Windows Phone 7上无法通过编程进行控制,但我需要一个Windows Phone 8的解决方案。

2个回答

1
以下是内容翻译:
在Windows 8的Internet Explorer 10和Windows Phone的Internet Explorer 10之间,存在一些细微差别需要您注意。 Windows Phone的Internet Explorer 10不支持以下功能: -通过脚本进行跨标签页通信(因此window.open会在同一标签页中打开目标网址) -同样,在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 - 打开链接获取完整列表。

有没有一种解决方法可以验证是否可以打开一个新窗口,以便在无法打开时使用备用方法? - Arnoud Sietsema

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接