Package com.google.gwt.core.client
Class ScriptInjector.FromString
java.lang.Object
com.google.gwt.core.client.ScriptInjector.FromString
- Enclosing class:
ScriptInjector
Builder for directly injecting a script body into the DOM.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioninject()
Injects a script into the DOM.setRemoveTag
(boolean removeTag) setWindow
(JavaScriptObject window)
-
Constructor Details
-
FromString
- Parameters:
scriptBody
- The script text to install into the document.
-
-
Method Details
-
inject
Injects a script into the DOM. The JavaScript is evaluated and will be available immediately when this call returns. By default, the script is installed in the same window that the GWT code is installed in.- Returns:
- the script element created for the injection. Note that it may be removed from the DOM.
-
setRemoveTag
- Parameters:
removeTag
- If true, remove the tag immediately after injecting the source. This shrinks the DOM, possibly at the expense of readability if you are debugging javaScript. Default value istrue
.
-
setWindow
- Parameters:
window
- Specify which window to use to install the script. If not specified, the top current window GWT is loaded in is used.
-