I am updating a vaadin project from vaadin 6
version to vaadin 7
. It contains some native Javascript methods which work well in the old version. However some of them throw an exception when they should be called. I am not acquainted enough to Javascript
programming and therefore I am not able to identify the source of the error. In particular the method is:
protected static native void addSthToImg()
/*-{
$wnd.$(document).ready(function() {
var = $wnd.$;
var('.settingswrapper > img').addClass("imgStartup");
if (var('.settingswrapper > img').hasClass("imgStartup")) {
console.log("imgStartup exist");
var('.settingswrapper > img')
.animate(null, 300, function() {
var('.settingswrapper > img').removeClass("imgStartup");
var('.settingswrapper > img').addClass("imagePopIn");
});
}
});
}-*/;
On the Console in Chrome I see the error stack trace:
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) : Object [object global] has no method '$'
What could be a possible cause of the error and why is it working in the old version? Is a jar/library missing?