//方式一:
// $.ajax(
// {
// url:"/web01/loginServlet",
// type:"post",
// data:{name:text},
// dataType:"json",
// success:function (result) {
// if(result.recode==1)
// {
// $("#jj").html("<font color='red'>"+result.retmsg+"</font>");
// }
// else {
// $("#jj").html("<font color='green'>"+result.retmsg+"√</font>");
// }
// },
// error:function () {
// alert("请联系管理员");
// }
// }
// )
// 方式二:
// var data = {name: text};
// $.get("/web01/loginServlet", data, function (result) {
// if (result.recode == 1) {
// $("#jj").html("<font color='red'>" + result.retmsg + "</font>");
// } else {
// $("#jj").html("<font color='green'>" + result.retmsg + "√</font>");
// }
// },"json")
// 方式二:
// var data = {name: text};
// $.getJSON("/web01/loginServlet", data, function (result) {
// if (result.recode == 1) {
// $("#jj").html("<font color='red'>" + result.retmsg + "</font>");
// } else {
// $("#jj").html("<font color='green'>" + result.retmsg + "√</font>");
// }
// },)
//方式三:
var data = {name: text};
$.post("/web01/loginServlet", data, function (result) {
if (result.recode == 1) {
$("#jj").html("<font color='red'>" + result.retmsg + "</font>");
} else {
$("#jj").html("<font color='green'>" + result.retmsg + "√</font>");
}
},"json")
}