public static class ScriptInjector extends Object
String scriptBody = "var foo = ..."; ScriptInjector.fromString(scriptBody).inject();
Usage with script loaded as URL:
ScriptInjector.fromUrl("http://example.com/foo.js").setCallback( new Callback() { public void onFailure(Exception reason) { Window.alert("Script load failed."); } public void onSuccess(Void result) { Window.alert("Script load success."); } }).inject();
Copyright © 2018. All rights reserved.