My bad; Jan is of course correct... :) On Feb 9, 8:50 am, Jan Ehrhardt <[email protected]> wrote: > The $ method is in the global namespace, which cannot be accessed from GWT > native JS code directly. You'll have to use the $wnd variable instead, which > brings the global namespace to GWT. So the first method of the simple > example has to look like this: > > public static native Object query(String selector) /*-{ > return($wnd.$(selector)); > > }-*/; > > Regards > Jan Ehrhardt > > On Tue, Feb 9, 2010 at 9:30 AM, dougx <[email protected]> wrote: > > There's no magic to this; just add jquery to the page as a javascript > > include and then use JSNI to invoke various calls. > > > Here is a trivial example: > > > public static native Object query(String selector) /*-{ > > return($(selector)); > > }-*/; > > > public static native void hide(Object target) /*-{ > > target.hide(); > > }-*/; > > > public void javaTest() { > > Object objects = query(".mytarget"); > > hide(objects); > > } > > > If you want to have access to a more 'complete' jquery interface, you > > can have a look at the GQuery project; you'll have to get the source > > and rebuild it yourself, however, to use it with 2.0 > > > ~ > > Doug. > > > On Feb 9, 3:41 pm, muhannad nasser <[email protected]> wrote: > > > Dear all; > > > > can u please tell me how to use jQuery in GWT... do i need to add > > something > > > to xml files..... and how to call the jQuery functions > > > > thanks > > > > -- > > > ~~~With Regards~~~ > > > Muhannad Dar-Nasser > > > ~~Computer Systems Engineering~~ > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google Web Toolkit" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<google-web-toolkit%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/google-web-toolkit?hl=en.
-- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
