DWRUtil未定义 错误解决

连个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,DWR)