[英]unable to use external javascript in GWT
I want to use goJS with GWT. 我想在GWT中使用goJS。 I downloaded GOJS javascript and put it in the sampleproject folder under war where sampleproject.nocache.js and sampleproject.devmode.js is present. 我下载了GOJS javascript,并将其放在存在sampleproject.nocache.js和sampleproject.devmode.js的战争中的sampleproject文件夹中。 In sampleproject.html i added 在sampleproject.html中,我添加了
<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. com.google.gwt.event.shared.UmbrellaException:捕获到异常:(ReferenceError)@ com.amazon.ops.client.OpsMenuView :: initGo()([]):go未定义。
Can anyone please help me with this? 谁能帮我这个忙吗?
Make sure that you put this statement: 确保您输入以下语句:
<script type="text/javascript" language="javascript" src="sampleproject/go.js">
</script>
before <script src="sampleproject.nocache.js">
statement. 在 <script src="sampleproject.nocache.js">
语句之前。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.