English 中文(简体)
用户代理替代
原标题:User Agent Alternative

如何使用 user agent 检测移动浏览器跳出?

尝试在网中查找,但发现的所有链接都为 < em> 用户代理 < / em>

问题回答

它取决于您是否在服务器端还是客户端。 服务器端您几乎只局限于用户代理, 除非您真的自定义 。

客户端您可以将图书馆看成是现代化的js 或yopnoope.js。 它们可能在幕后使用用户代理数据, 不确定 。

当然,如果浏览器让 JavaScript 禁用的话, 您也会因此失去运气 。

Simple answer: you can t, at least on the server side.
But, more importantly, why would you want not to use the user agent string?

如果您只想检测浏览器是否移动, 我会使用 JavaScript 来做这个操作, 只需根据设备屏幕大小/ 分辨率来猜测它 。





相关问题
How can I make mobile version of an existing web site?

We have a website coded with jsp-Java. Now, we want to show our website more user friendly on blackberry etc. Is there any tool or method to do this issue more easier? thanks for your answers.

Should I make my mobile application for Mobile 6 or Mobile 5?

I am going to be making a small application very soon. I am wondering would it be better to go and make it for 6.0 or should I make it for 5.0? I don t know much about both versions but I guessing ...

How do I combine @font-face and @media declarations?

I d like to build a common typography stylesheet with a very small number of selectors. As such, I d far prefer to use @media sections for the various versions rather than create different files, each ...

热门标签