aem*_*aem 25
跨浏览器支持的GWT Developer's Guide页面提供了一个返回UserAgent字符串的JSNI函数.
但请注意,您可能希望使用Deferred Binding来编写特定于浏览器的代码,而不是检测UserAgent.
编辑: Kasturi指出Window.Navigator.getUserAgent(),它实现如下:
/**
* Gets the navigator.appName.
*
* @return the window's navigator.appName.
*/
public static native String getAppName() /*-{
return $wnd.navigator.appName;
}-*/;
Run Code Online (Sandbox Code Playgroud)
所以,是的,这应该执行跨浏览器支持页面上提到的功能(除了它不会调用toLowerCase()),尽管再次使用延迟绑定可能会更好.
归档时间: |
|
查看次数: |
18572 次 |
最近记录: |