GWT inject script element into the html file

后端 未结 4 782
予麋鹿
予麋鹿 2021-02-05 23:51

On my gwt project. i have a script that call the dictionary:


i

4条回答
  •  别那么骄傲
    2021-02-06 00:13

    Use com.google.gwt.core.client.ScriptInjector, since it was created specifically for stuff like this

    ScriptInjector.fromUrl("conf/iw_dictionary.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();
    

提交回复
热议问题