Sunday, July 27, 2014

Re: unable to use external javascript in GWT

Try it like this:

public static native void initGo() /*-{
var $$ = $wnd.go.GraphObject.make;
}-*/;

Also, you can add external js to your GWT project by dropping the files into your project/public/ directory and adding them to your project.gwt.xml file like this:


  <!-- External JavaScript http://html2canvas.hertzen.com/        -->

  <script src="html2canvas.min.js"/>


  <!-- External JavaScript JQuery UI Tooltip http://jqueryui.com/ -->

  <script src="jquery-1.11.1.min.js"/>

  <script src="jquery-ui.min.js"/>

  <stylesheet src="jquery-ui.min.css"/>

  <stylesheet src="jquery-ui.structure.min.css"/>


On Sunday, July 27, 2014 1:11:22 AM UTC-7, 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>

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

com.google.gwt.event.shared.UmbrellaException: Exception caught: (ReferenceError) @com.amazon.ops.client.OpsMenuView::initGo()([]): go is not defined.

Can anyone please help me with this?

thanks,
sandeep

--
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 google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment