00001 function AjaxGet(getUrl, fnCallback) {
00002
00003
00004 if (AjaxGet.Xhr) {
00005
00006 AjaxGet.Xhr.abort();
00007 }
00008
00009
00010
00011 AjaxGet.Xhr = $.ajax({
00012 type: "get",
00013 url: getUrl,
00014 dataType: "json",
00015
00016 success: function (objData) {
00017
00018
00019 fnCallback(objData);
00020 },
00021
00022 error: function (xhr, textStatus, errorCode) {
00023
00024 },
00025
00026 complete: function () {
00027
00028 AjaxGet.Xhr = null;
00029 }
00030 });
00031 }
00032
00033 function AjaxPost(postUrl, postData, fnCallback) {
00034
00035
00036 if (AjaxPost.Xhr) {
00037
00038 AjaxPost.Xhr.abort();
00039 }
00040
00041
00042
00043 AjaxPost.Xhr = $.ajax({
00044 type: "post",
00045 url: postUrl,
00046 dataType: "json",
00047 data: JSON.stringify(postData),
00048
00049 success: function (objData) {
00050
00051
00052 fnCallback(objData);
00053 },
00054
00055 error: function (xhr, textStatus, errorCode) {
00056
00057 },
00058
00059 complete: function () {
00060
00061 AjaxPost.Xhr = null;
00062 }
00063 });
00064 }