开发者

GWTTestcase accessing javascript object defined in an external javascript file fails

I have defined a GWT module that includes an external javascript file using tag. I have written a GWTTestCase that returns the above described module's name. When my testcase accesses a javascript object I see 开发者_如何学Pythonthe following exception

Caused by: com.google.gwt.core.client.JavaScriptException: (null): null

Any idea on how to fix this?

Am I right in assuming that the scripts included in the gwt module definition file will be available when executing the GWTTestCase?


I have fixed it myself. Apparently, when accessing such objects it should be referenced using $wnd variable.

Example: test.js defined object test. In order to access it from GWT one should use, $wnd.test

Hope this answers saves somebody else' time.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜