【网页自动识别客户端跳转到手机版】

  • A+
所属分类:【折腾博客】

用户用手机访问电脑版网站自动跳到手机版网站实现代码,下面是通过判断用户的发送的头信息进行相应的跳转;变量{$wapurl}就是对应当前访问的URL跳到对应的手机版网站URL;当然可以把{$wapurl}改成你自己的手机网站地址;

123456

[box style="download"]
www.baidu.com
[/box]

[box style="grey"]
var mobileAgent = new Array("iphone", "ipod", "ipad", "android", "mobile", "blackberry", "webos", "incognito", "webmate", "bada", "nokia", "lg", "ucweb", "skyfire");
var browser = navigator.userAgent.toLowerCase();
var isMobile = false;
for (var i=0; i

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: