$.ajax({
type:"get",
url:"login",
cache:false,
dataType:text,
data:{
userName:name,
userPassword:pas,
userCheck:certCode
},
success:function(data){
alert("success"+data);
}
});
Struts中定义action(ajax能请求到,action没有返回值)
<action name="login" class="logService" method="administrator" />
action里面返回给ajax数据:
out.print("密码输入不正确!");
为什么结果不在success的函数中,而是直接返回了一个空白页面,字符串显示到这个页面上?