2012-05-22 92 views
3

I am using防止在<a href="tel"> in IE

<a href="tel:123-456-7890">123-456-7890</a> 

in my website specifically for mobile but it is also shown in web browsers. Every browser didn't open a page while clicking on it instead of IE.

Any solution to prevent to open a page while clicking this number in IE.

回答

1

Try it like this:

<a href="#" value="tel:123-456-7890">123-456-7890</a> 

Than you could use a JS browser detection, see in this tread: http://www.webdeveloper.com/forum/showthread.php?t=210710 上打开页面,然后您可以更改IE中的链接,并在其他浏览器和移动设备上保持相同。

我用这样的事情在WordPress:

global $is_IE; 
if(!$is_IE){ 
?><a href="tel:555-555" >555-555</a><?php 
} else 
{ ?>555-555<?php } 
+0

这种技术是没用的,因为在移动设备上我不能使用这种技术实现我的目标。感谢您及时的回复。 –

+0

@Ahsan是的,你可以。 JQuery也适用于移动设备。或者(*警告*在盒子外面思考未来!)相反,只有用JQuery删除IE上的href。 –

+0

@Mahmoud:你能用例子来澄清一下吗? –