Embed javascript in GWT

How to insert java-script into Java code written in gwt Please provide an example.

+3


source to share


1 answer


here are some docs to help you get started

http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI.html

here's a simple example of a native method:



private native void nativeMethod()
/*-{
      $wnd.jsFunction = function(x) {
        alert(x);
      };
      alert("hello");
}-*/;

      

it creates a javascript function called jsFunction

which can be called from HTML or any other javascript. and then he announces.

+6


source







All Articles