如何在javascript中重定向移动网站 [英] how to redirect mobile website in javascript

查看:75
本文介绍了如何在javascript中重定向移动网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作两个网站,一个是桌面网站,另一个是移动网站,因此如何重定向移动网站.请帮我举个例子

解决方案

hi,

识别所有移动设备非常困难,但是您可以使用 http://www.hand- Interactive.com/resources/detect-mobile-javascript.htm 此链接 解决方案

hi ,

It is very difficult to identify all mobile device,but you can use
http://www.hand-interactive.com/resources/detect-mobile-javascript.htmthis link^ to detect some of smart phone.

you need to check all mobile device(you wont to target) and check it''s user agent and add more if condition in given sample code.

you can also use CSS3 media query.

but it is more better if you do this on server side as it is more robust ans sever requests also contain client user agent value


这篇关于如何在javascript中重定向移动网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆