连个helloword都报错,
jsp:
<script type='text/javascript'>
function hello() {
var user = $('user').value;
alert(user);
Hello.hello(user, callback);
}
function callback(msg) {
alert(msg);
DWRUtil.setValue('result', msg);
}
</script>
下载的dwr3,一直提示DWRUtil未定义,添加xalan.jar也不好使
解决办法:在DWRUtil.setValue('result', msg);前加入
if (typeof window['DWRUtil'] == 'undefined')
window.DWRUtil = dwr.util;
jsp:
<script type='text/javascript'>
function hello() {
var user = $('user').value;
alert(user);
Hello.hello(user, callback);
}
function callback(msg) {
alert(msg);
DWRUtil.setValue('result', msg);
}
</script>
下载的dwr3,一直提示DWRUtil未定义,添加xalan.jar也不好使
解决办法:在DWRUtil.setValue('result', msg);前加入
if (typeof window['DWRUtil'] == 'undefined')
window.DWRUtil = dwr.util;
本文介绍了一个使用DWR框架时遇到的问题:DWRUtil未定义。文章提供了一种解决方案,即通过检查DWRUtil的定义状态并在必要时将其设置为dwr.util来解决此问题。
2265

被折叠的 条评论
为什么被折叠?



