document.write("");
document.write("");
function ajaxSubmit(frm, fn) {
var dataPara = getFormJson(frm);
$.ajax({
url: frm.action,
type: frm.method,
data: dataPara,
dataType:'json',
success: fn
});
}
function getFormJson(frm) {
var o = {};
var a = $(frm).serializeArray();
$.each(a, function () {
if (o[this.name] !== undefined) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');
} else {
o[this.name] = this.value || '';
}
});
return o;
}
/**
url 0 刷新本页 其他跳转
**/
function ats(msg,type,url=null){
new NoticeJs({
text: msg,
type:(type==1)?'success':'error',
timeout: 10,
closeWith:'click',
position: 'topCenter',
}).show();
if(url!=2){
setTimeout(function(){
if(url == 0){
location=location;
}else{
location.href=url;
}
},1000);
}
}