手机电脑打开同一链接

打开手机电话:<a href="tel://15183569686">15183569686</a>
打开手机QQ:<a class="ceshi" href="tencent://message/?Site=baidu.com&uin=1640035810&Menu=yes">1640035810</a>
自动判断是手机还是电脑,分别用不同的方式打开超链接:
<p>Q Q:<a class="ceshi" href="javascript:qqlink( )">1178453114</a>
<script type="text/javascript">
function qqlink()
{
if(/phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|WebOS|Symbian|Windows Phone/i.test(navigator.userAgent))
  {
    window.location.href="mqqwpa://im/chat?chat_type=wpa&uin=1178453114";
  }
 else
  {
      window.location.href="tencent://message/?Site=baidu.com&uin=1178453114&Menu=yes";
   }
}
</script>
<script type="text/javascript">
window.location.href = /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|WebOS|Symbian|Windows Phone)/i.test
(navigator.userAgent)?"mqqwpa://im/chat?chat_type=wpa&uin=1178453114":"tencent://message/?Site=baidu.com&uin=1178453114&Menu=yes";
</script>

上一篇:CentOS下安装cronolog拆分tomcat日志文件catalina.out


下一篇:【Java】接口