<div id=temp></div><button id="changeME">changeme</button>
<form name="add">
<input type="text" name="a"/>
<input type="text" name="b"/>
</form>
<script>
dojo.addOnLoad(function(){
var changeMeButton=dojo.byId("changeME");
//给按钮添加点几事件
dojo.event.connect(changeMeButton,"onclick",function(){
//调用ajax
dojo.io.bind({
url:"/crifa/BusinessInfoList.do",
content: {a: 1,b: 2},//url参数方式
formNode:add //表单方式
mimeType:"text/plain",
load:function(type,data,evt){
alert(data);
},
error:function(type,evt){
alert(data);
}
});});
});
</script>
BusinessInfoList.java
response.setCharacterEncoding(
"
utf-8
"
);
PrintWriterout = response.getWriter();
out.print(a + b);
return null ;
一定要返回null
PrintWriterout = response.getWriter();
out.print(a + b);
return null ;
一定要返回null