var username = $("#username"),val();
var password = $("password").val();
var obj = {"username":username,"password":password};
// obj 就是把form里面的 input全部装进来,这是json格式 在ajax 里传入后台,后台可以用//request.getparam("username");
//request.getparam("password "); 取得对应的值。 明白?
$.ajax({
type:post,
async:false,
url:"<%=basePath %>/fileReceive/addReceive.shtml",
data: obj,
dataType:"text"
error:function(){
alert("error');
}
success:function(data){
if(data=="success"){
alert("收发文增加成功");
window.returnValue=data;
receiveName.submit();
window.close;
}else{
alert("收发文增加失败");
return;
}
function request(strUrl, data, func){
$.ajax({
cache:false,
type:"post",
url:strUrl,
dataType:"json", //"html", //
data:data, // {NAME:VALUE}
ifModified:false,
async:true,
beforeSend: function(XMLHttpRequest){/*ShowLoading(); */ },
complete :function(XMLHttpRequest, status){
try{isBusy=false;}catch(e){}
},
error: function (xhr, status, errMsg){
if("parsererror"==status){
alert("查询失败,请稍等再试。");
}else{
alert(status+":"+errMsg);
}
},
success: func
});
}