Take the 2-minute tour ×

I have a function Load() in a js file which I added to the GWT module.

I am trying to call it using

private static native void load() /*-{

but it gives me error like

Error(s) occurred! (TypeError): $doc.Load is not a function fileName: http://localhost:8888/myapp/888C05FB242806B071A932498F6B5AD9.cache.html lineNumber: 1224

I even tried with $wnd.Load()

What the proper way of calling it?

share|improve this question
What do you mean by "I added to the GWT module"? You can just include the js file in your host page via a <script> tag and then the $wnd.Load() reference should work. –  Igor Klimer Apr 6 '10 at 22:16
add comment

1 Answer

up vote 0 down vote accepted

Igor is correct. Consider the following snippet from the host HTML file:

    <script language="JavaScript">
    function dostuff() {
        alert("Stuff is being done.");

    <!--                                                               -->
    <!--                                                               -->
    <link type="text/css" rel="stylesheet" href="GxtSandbox.css">

And the following snippet from GWT code:

public void onModuleLoad() {

public native void doGwtStuff() /*-{

This alert is shown.

share|improve this answer
add comment

Your Answer


