Sunday, July 27, 2014

Re: unable to use external javascript in GWT

On Sunday, July 27, 2014 10:11:22 AM UTC+2, Sandeep Poonia wrote:
Hi ,
I want to use goJS with GWT. I downloaded GOJS javascript and put it in the sampleproject folder under war where sampleproject.nocache.js and sampleproject.devmode.js is present. In sampleproject.html i added 
<script type="text/javascript" language="javascript" src="sampleproject/go.js"></script>

You shouldn't put the file there. The sampleproject/ folder will be cleared by the GWT Compiler.
Either put your script in your "public path" so it gets copied there by the GWT Compiler [1], or put it outside the sampleproject/ folder.
[1] see

In one of the view i used 
public static native void initGo() /*-{
var $$ = go.GraphObject.make;
when i call this function , exception is thrown: Exception caught: (ReferenceError)[]): go is not defined.

Can anyone please help me with this?

As Jim already said, you need to use $wnd to escape the sandbox GWT is running in and into the context of the web page, where your script is loaded.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment