开发者

window.open on Windows Phone 7

开发者 https://www.devze.com 2023-04-01 01:35 出处:网络
I am looking for any information, or help with an issue I am having with Mobile IE9 on Windows Phone 7 Mango; although I would settle for a resolution on开发者_StackOverflow Windows Phone 7 in general

I am looking for any information, or help with an issue I am having with Mobile IE9 on Windows Phone 7 Mango; although I would settle for a resolution on开发者_StackOverflow Windows Phone 7 in general.

    <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>

I am using this. http://jsfiddle.net/ag7wU/1/embedded/result/

When I select any of these elements on the Windows Phone 7.0/7.1, I navigate to google.com. On every other browser I can readily find, a new window/tab is created: Chrome, Firefox 6.0, Opera 11.50, IE9, Safari, WebKit on BB OSv6, Dolphin on Android 2.3.3, Dolphin on android 3.2, and mobile safari on the IPhone and IPad.

The only exception is windows phone 7. The best solution I can find is to use the anchor tag and href attribute, and instruct users that they are going to have to hold down the links they want, and select "open in new tab" Am I missing something?


You should always provide a fallback for environments that do not support multiple tabs and windows (or JavaScript).

You want to make sure that the browser can display a real URL when the user hovers over the link, and that the link is long-press/right-click copyable.

You also want to preserve link URLs for indexers, link checkers, offline archivers like archive.org, and other robots.

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

精彩评论

暂无评论...
验证码 换一张
取 消