//private function refreshUrl(result) { if(result.url === undefined||result.url===''){ parent.location.reload(); }else{ window.location.href=result.url; } } //private function showResultInfo(result) { if(result.status == 1) { if (result.info != undefined && result.info != '') { $.alert(result.info, "提示", function () { refreshUrl(result); }); }else{ refreshUrl(result); } }else{ if(result.info!=undefined&&result.info!=''){ $.alert(result.info, "提示", function () { if(result.url === undefined||result.url===''){ // parent.location.reload(); }else{ window.location.href=result.url; } // refreshUrl(result);  }); }else{ if(result.url === undefined||result.url===''){ // parent.location.reload(); }else{ window.location.href=result.url; } // refreshUrl(result); } } } // $(document).ready(function () { // //表单静态提交,并且刷新本页 // $('.ajax-form').ajaxSubmit(function(result){ // showResultInfo(result); // }); // }); function isFunction(fn) { return Object.prototype.toString.call(fn) === '[object Function]'; } function get_data(url, callback) { $.showLoading(); $.get(url, function (result) { $.hideLoading(); if (callback != undefined && isFunction(callback)) { callback(result); } }); } function post_data(url, data, callback) { $.showLoading(); $.post(url, data, function (result) { $.hideLoading(); if (callback != undefined && isFunction(callback)) { callback(result); } }); }