ArcBees / gwtquery

A jQuery clone for GWT, and much more.
MIT License
85 stars 38 forks source link

$(window).on("scroll") - Something other than a short was returned from JSNI method #355

Open nicolasps opened 9 years ago

nicolasps commented 9 years ago

Hi,

I'm usuing gwtQuery 1.4.2 and whe I tried to bind the scroll event using the window object, like this:

CODE

$(window).on("scroll", new Function() { @Override public void f() { //code } });

PROBLEM:

It throws this error: "Something other than a short was returned from JSNI method @com.google.gwt.dom.client.Node::getNodeType()': JS value of type undefined, expected short"

WORKAROUND

I could bind the scroll event to the document object without problems and get the same result.

$(document).on("scroll", new Function() { @Override public void f() { //code } });