gpt4 book ai didi

javascript - Windows Phone 7 上的 window.open

转载 作者:搜寻专家 更新时间:2023-10-31 08:37:07 25 4
gpt4 key购买 nike

我正在寻找任何信息,或帮助解决我在 Windows Phone 7 Mango 上使用 Mobile IE9 时遇到的问题;尽管我一般会接受 Windows Phone 7 上的解决方案。

    <input type="button" value="input" onclick="window.open('http://www.google.com')" />
<span onclick="window.open('http://www.google.com')">span</span>
<a href="#" onclick="window.open('http://www.google.com'); return false">anchor</a>

我正在用这个。 http://jsfiddle.net/ag7wU/1/embedded/result/

当我在 Windows Phone 7.0/7.1 上选择这些元素中的任何一个时,我导航到 google.com。在我可以轻松找到的所有其他浏览器上,都会创建一个新窗口/选项卡:Chrome、Firefox 6.0、Opera 11.50、IE9、Safari、BB OSv6 上的 WebKit、Android 2.3.3 上的 Dolphin、android 3.2 上的 Dolphin 和移动 safari iPhone 和 iPad。

Windows Phone 7 是唯一的异常(exception)。我能找到的最佳解决方案是使用 anchor 标记和 href 属性,并指示用户他们将不得不按住他们想要的链接,然后选择“在新窗口中打开”选项卡“我错过了什么吗?

最佳答案

您应该始终为不支持多个选项卡和窗口(或 JavaScript)的环境提供回退。

您要确保当用户将鼠标悬停在链接上时浏览器可以显示真实的 URL,并且该链接可以长按/右键单击复制。

您还希望为索引器、链接检查器、离线存档器(如 archive.org)和其他机器人保留链接 URL。

<a href="http://www.google.com" onclick="return!window.open(this.href)">anchor</a>

关于javascript - Windows Phone 7 上的 window.open,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7232432/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com