public static void inject(String javascript) {
    HeadElement head = getHead();
    ScriptElement element = createScriptElement();
    element.setText(javascript);
    head.appendChild(element);
  }
public static void inject(String javascript) {
    HeadElement head = getHead();
    ScriptElement element = createScriptElement();
    element.setText(javascript);
    head.appendChild(element);
  }
public static void inject ( String javascript ) { HeadElement head = getHead ( ) ; ScriptElement element = createScriptElement ( ) ; element . setText ( javascript ) ; head . appendChild ( element ) ; }
Injects the JavaScript code into a
{@code <script type="text/javascript">...</script>} element in the
document header.

@param javascript the JavaScript code
Injects the JavaScript code into a { @code <script type = text / javascript > ... < / script > } element in the document header .