code: public static void whenReady(final EventListener function) {
      JQueryResources.eventLisenerQueue.add(function);
      if (JQueryResources.initializationStarted || JQueryResources.isInHeader()) {
        if (JQueryResources.isInitialized()) {
          JQueryResources.eventLisenerQueue
              .forEach(action -> action.handleEvent(JQueryResources.rememberEvent));
          JQueryResources.eventLisenerQueue.clear();
        }
        return;
      }
      JQueryResources.initializationStarted = true;
  
      final ScriptElement jqueryScript = Browser.getDocument().createScriptElement();
      jqueryScript.setSrc(JQueryResources.JQUERY_URL);
      jqueryScript.setType(JsResources.SCRIPT_TYPE);
  
      Browser.getDocument().getHead().appendChild(jqueryScript);
  
      jqueryScript.setOnload(event -> {
        JQueryResources.eventLisenerQueue.forEach(action -> action.handleEvent(event));
        JQueryResources.eventLisenerQueue.clear();
        JQueryResources.rememberEvent = event;
      });
    }
docs: async load of resources.
  
  @param function function to call on load