Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6389449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:24:16+00:00 2026-05-25T03:24:16+00:00

I am a GWT person with zero jquery experience. Sorry about that. Unfortunately, I

  • 0

I am a GWT person with zero jquery experience. Sorry about that. Unfortunately, I am encountering some jquery features which I have to use in my GWT project.

<script type="text/javascript">
$(document).ready(function() {
    zingchart.render({
        'id' : 'g1',
        'width' : 500,
        'height' : 400,
        'dataurl' : 'scatter_minimal.txt'
    });
    });
</script>

<div class="g" id="g1"></div>

In my scratchy intuition, I am about to believe that

$(document).ready( ..)

should be translated as GWT’s onModuleLoad(){ ....}, where onModuleLoad would ensure that the DOM is ready, if I called that function within onModuleLoad.

But I don’t think the following would be valid ..

private static native void render() /*-{
  function() {
    zingchart.render(
      {
        'id' : 'g1',
        'width' : 500,
        'height' : 400,
        'dataurl' : 'scatter_minimal.txt'
      }
    );
  }
}-*/;

How would I code the JSNI to define that function that I could call from GWT?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:24:16+00:00Added an answer on May 25, 2026 at 3:24 am

    If I understand your question correctly, what you want to do is simply:

    private static native void render() /*-{
        zingchart.render(
          {
            'id' : 'g1',
            'width' : 500,
            'height' : 400,
            'dataurl' : 'scatter_minimal.txt'
          }
        );
    }-*/;
    

    Then you can call render() from your GWT code. render is the function itself, GWT already defines it for you as a JavaScript function when you use the JSNI syntax.

    Background:

    Writing function() {...} defines an anonymous function – which is not what you want here (you wouldn’t have any way to refer to it, because you don’t pass it anywhere). In jQuery, you pass that anonymous function directly to document.ready().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an inheritance hierarchy with overlap. The system knows about People that can
I have a POJO that is used with GWT's RequestFactory and an associated proxy.
First some context: I have an MVC3 .net project which, for the sake of
I have a question about how to do data filtering with RequestFactory in GWT.
Does gwt have (good) support for effects, moving around elements, and resizing them? Are
I pass a ViewModel (which contains a Person object) from the EditPerson controller action
I have the following code: jQuery: $.ajax({ url: '/personcontroller/getperson', cache: false, type: POST, data:
I have an external Web Service that returns back its own object, and I
I'm writing a messaging application in GWT, and have a fairly difficult problem to
I am developing a GWT application which im using Spring Security to handle the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.