3

I created a JSNI function when the page reach on the bottom it will call some method but i'm having a problem on calling it here is my code

public static native void scroll() /*-{
    var that = this;
    $wnd.$($wnd).on("scroll", function($) {
        var scrollHeight = $wnd.$($doc).height();
        var scrollPosition = $wnd.$($wnd).height() + $wnd.$($wnd).scrollTop();
        if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
            $wnd.$('#loadmore').removeClass('uk-hidden');
            return [email protected]::query(*)(null);
        }
    });
}-*/;

When I try to call this JSNI I receive an error

Uncaught TypeError: that_0_g$.query_2_g$ is not a function

1
  • Why would you create a JSNI function for the scroll in the first place? This functionality can be done with GWT, and makes it much more easy to maintain. Commented Sep 15, 2016 at 18:15

1 Answer 1

3

Your method is static so there's no this!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.