/*** * ajax获取服务端数据 * @url 业务数据 * @data */ var isallow = true; function doajaxget(url, data,fnsuc, fnerr) { $.ajax({ url: url, type: "get", data: data, datatype: 'json', contenttype: 'application/json', beforesend: function () { isallow = false; layer.open({ content: '正在提交,请稍后。。。', time: 2 }); }, success: fnsuc, error: fnerr, complete: function () { isallow = true; } }); } function doajaxpost(url, data, fnsuc, fnerr) { $.ajax({ url: url, type: 'post', data: data, datatype: 'json', contenttype: 'application/json',//必须有 beforesend: function () { isallow = false; //layer.open({ // content: '正在提交,请稍后。。。', // time: 2 //}); }, success: fnsuc, error: fnerr, complete: function () { isallow = true; } }); }