确定浏览器在gwt bootstrap中运行的设备 [英] determine if the device on which browser is running in gwt bootstrap

查看:152
本文介绍了确定浏览器在gwt bootstrap中运行的设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

他们在gwt或gwt引导程序中找到运行web应用程序的设备。
如果设备是iphone,tablet,desktop.ipad等,请帮助。

t需要bootstrap来知道你的客户端运行在哪个浏览器上。



只需调用...

  Navigator.getUserAgent()

...让用户浏览器的代理。



这里提供了所有用户使用avaiable的列表:

http://www.useragentstring.com/pages/All/



例如,检查用户代理字符串中的ipad匹配。


Is their any way in gwt or gwt bootstrap to find the device on which the web app is running. Like if the device is iphone,tablet,desktop.ipad etc.,Please help.

解决方案

You don't need bootstrap at all to know which browser your client is running on.

Just call...

Navigator.getUserAgent() 

...to get the user-agent of the browser.

A list of all user-ager avaiable is provided here:

http://www.useragentstring.com/pages/All/

For instance, check for "ipad" match in user-agent String.

这篇关于确定浏览器在gwt bootstrap中运行的设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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