如何使用 jQuery 或其他一些简单的方式检测移动浏览器..? [英] How to detect mobile browser using jQuery or in some other SIMPLE way..?

查看:16
本文介绍了如何使用 jQuery 或其他一些简单的方式检测移动浏览器..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能的重复:
在 jQuery 中检测手持设备的最佳方法

我想为我的网络应用制作一个移动版本.我如何运行检测请求是从桌面浏览器还是移动浏览器发出的函数?

I want to make a mobile version of my web app. How I can run a function that will detect if a request is being made from a desktop or mobile browser?

这样,如果用户从移动浏览器发出请求并且他们点击了一个链接,而不是转到实际页面,它应该被劫持并执行一些其他事件..

This is so that if the user is requesting from a mobile browser and they click on a link, rather than go to the actual page, it should get hijacked and do some other event..

提前致谢..

推荐答案

检测移动浏览器上有几个脚本在服务器端或使用 JavaScript 或 jQuery 重定向移动访问者.

There are a few scripts on Detect Mobile Browser that redirect mobile visitors on the server side or with JavaScript or jQuery.

这篇关于如何使用 jQuery 或其他一些简单的方式检测移动浏览器..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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