1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- //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);
- }
- });
- }
|