Last active
December 15, 2015 13:39
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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