how to get the client type( ie or other explorer) and version( ie8 or lower)?

2009-05-30 Thread dufeng...@gmail.com

i want to check the client type and version with the gwt ,how can i do?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: how to get the client type( ie or other explorer) and version( ie8 or lower)?

2009-05-30 Thread Thomas Broyer


On 30 mai, 09:19, dufeng...@gmail.com dufeng...@gmail.com wrote:
 i want to check the client type and version with the gwt ,how can i do?

Don't do it by code, use deferred binding when possible.
http://code.google.com/webtoolkit/doc/1.6/DevGuideCodingBasics.html#DevGuideDeferredBinding

For versions, well, do it by code, in JSNI, GWT itself contains some
of those checks (Safari 2 vs. Safari 3, or just in the user.agent
property provider, in UserAgent.gwt.xml)

But may I ask you why you'd like to make such a check?

If it is because your app only supports a subset of the browsers
supported by GWT, you can compile your app for the subset only:
   set-property name=user.agent value=ie6,gecko1_8 /
and then use some plain old JS in your host page:
   meta name=gwt:onPropertyErrorFn content=my_func
   script
  function my_func(propName, allowedValues, value) {
 if (propName == user.agent) {
// do your error handling here, e.g.
alert(Your browser isn't supported.);
 }
  }
   /script

(note that IE8 support is added in SVN and should be part of the next
release, including the next dot release of GWT 1.6)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---