Skip to content

Instantly share code, notes, and snippets.

@nikhilv
Last active December 15, 2015 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikhilv/5269156 to your computer and use it in GitHub Desktop.
Save nikhilv/5269156 to your computer and use it in GitHub Desktop.
gist for ask.electric-cloud.com question about jsni and accessing javascript from an ElectricCommander GWT plugin.
// In your javascript file
var sayHello = function(){
alert("Hello World!");
}
// In your <Component>.java file
import com.google.gwt.core.client.JavaScriptObject;
public native JavaScriptObject callNative() /*-{
$wnd.sayHello();
}-*/;
// In the doInit()
callNative();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment