public JavaScriptObject inject() {
            final JavaScriptObject wnd = (window == null)
                    ? nativeDefaultWindow()
                    : window;
            assert wnd != null;
            final JavaScriptObject doc = nativeGetDocument(wnd);
            assert doc != null;
            final JavaScriptObject scriptElement = nativeMakeScriptElement(doc);
            assert scriptElement != null;
            if (callback != null || removeTag) {
                attachListeners(scriptElement, callback, removeTag);
            }
            nativeSetSrc(scriptElement, scriptUrl);
            nativeAttachToHead(doc, scriptElement);
            return scriptElement;
        }
Injects an external JavaScript reference into the document and
optionally calls a callback when it finishes loading.

@return the script element created for the injection.
stroom-core-client/src/main/java/stroom/dashboard/client/vis/MyScriptInjector.java