第一种:直接JS脚本

<script type="text/javascript">
try {
var urlhash = window.location.hash;
if (!urlhash.match("fromapp"))
{
if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i)))
{
window.location="http://www.laozuo.org(更换成自己的WAP网站)";
}
}
}
catch(err)
{
}</script>

第二种:引用

function uaredirect(murl){
try {
if(document.getElementById("bdmark") != null){
return;
}
var urlhash = window.location.hash;
if (!urlhash.match("fromapp")){
if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i))) {
location.replace(murl);
}
}
} catch(err){}
}

只要将代码放在电脑版网站一个公共包含的文件里即可

最新文章

  1. HDU 5055 Bob and math problem(简单贪心)
  2. AIX 5L 系统管理技术 —— 存储管理——物理卷
  3. $http服务和$location
  4. Android Handler机制(四)---Handler源码解析
  5. bzoj4400: tjoi2012 桥
  6. What does &quot;Rxlch&quot; mean in ENCODE?
  7. 安装Ubuntu 16.04后要做的事
  8. Hark的数据结构与算法练习之简单选择排序
  9. Yii 实现MySQL多库和读写分离
  10. eclipse 默认jdk 的设置 eclipse.ini -vm 参数
  11. 将markdown格式转化为bootstrap风格html
  12. 《HelloGitHub》第12期
  13. 【Darwin】 越狱后玩耍IPhone系统
  14. 使用boost.python封装C++库
  15. Day30--Python--struct, socketserver
  16. JS获取当前日期、比较日期大小
  17. python获取两个日期间的工作日
  18. C语言笔记变量与数据类型
  19. (17)Questioning the universe
  20. Visual Studio 2013中引入Web Service的简单方法visual studio 引用 wsdl

热门文章

  1. 【BZOJ】3850: ZCC Loves Codefires(300T就这样献给了水题TAT)
  2. 【BZOJ】2875: [Noi2012]随机数生成器(矩阵乘法+快速乘)
  3. HDU 4614 Vases and Flowers(线段树+二分)
  4. 提升 web 应用程序的性能(二)
  5. hdu-acm steps Monkey and Banana
  6. CVE-2013-3908 Internet Explorer打印预览功能可导致信息泄露
  7. 直接双击运行PowerShell的脚本文件
  8. UVA 796 Critical Links(Tarjan求桥)
  9. php扩展redis,编译安装redis服务
  10. ThinkPHP 学习笔记 ( 三 ) 数据库操作之数据表模型和基础模型 ( Model )