0
后我有脚本文件custom.js html页面是引导对GWTGWT注入jQuery脚本页面加载
<!DOCTYPE html>
<html>
<head>
<!-- -->
<script type="text/javascript" src="login/login.nocache.js"></script>
<script type="text/javascript" src="common/js/custom.js"></script>
</head>
<div id="gwt-inject-place"/>
</html>
这是确定的,一切工作正常。 但是在custom.js中有一些函数需要在登录后触发/ login.nocache.js在<div id="gwt-inject-place"/>
中注入一些html。通常custom.js以某种方式在注入之前运行。
那我应该怎么做才能注入JavaScript jquery文件?
alert('global');
jQuery(document).ready(function()
{
alert('inner');
}
此注入custom.js但只有global alert
显示。
public void onModuleLoad(){
RootPanel.get("gwt-inject-place").add(view);
ScriptInjector.fromUrl("../common/js/custom.js").inject();
}