How to Use JQuery in GWT

After adding the JQuery script to your project HTML file’s head­er sec­tion

<script src="" type="text/javascript"></script>

You will be able to use JQuery in native (JSNI) meth­ods by prepend­ing $wnd., e.g.:

private native void someMethod() /*-{
	$wnd.$(function() {

With­out $wnd. you will end up with fol­low­ing error: (ReferenceError): $ is not defined

3 Replies to “How to Use JQuery in GWT

Leave a Reply

Your email address will not be published. Required fields are marked *