天天看點

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;