2012-06-07 61 views
0

我在客户端使用Canvas创建了一个网站来显示动画。有时候碰巧动画停止移动出突然,所以我跑在调试模式下的应用程序,并得到这个奇怪的错误:使用GWT画布的奇怪错误

com.google.gwt.dev.shell.HostedModeException: Something other than an int was returned from JSNI method '@com.google.gwt.dom.client.ImageElement::getWidth()': JS value of type undefined, expected int 

有什么能为这种现象的原因是什么?一个函数如何突然取消定义它的返回类型?

回答

2

您的代码应该没问题。 这是一个已知的chrome GWT插件问题。偶尔会出现这种情况,没有任何规则,最简单的解决方案是使用Firefox进行调试 - 它更稳定。

以下是讨论问题的链接:click here

+0

感谢您的回复!很高兴知道,尽管我的动画停止工作的原始错误仍然存​​在。让我们看看我能否使用Firefox找到真正的错误。 – Corsair