How to Use JQuery in GWT

After adding the JQuery script to your project HTML file’s header section

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

You will be able to use JQuery in native (JSNI) methods by prepending $wnd., e.g.:

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

Without $wnd. you will end up with following 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 *