jquery ajax 的封装

var tooAjaxData = new Object();

tooAjaxData = function () {
this.AjaxUrl =" ";
};

bookInfoClient.Data.prototype = {
AjaxGet: function () {
$.ajax({
type: "GET",
url: arguments[3] || this.AjaxUrl,
data: arguments[0] || "",
dataType: "jsonp",
jsonp: "callbackparam",
jsonpCallback: arguments[1] || "bookInfo",
success: arguments[2] || function () { },
complete: function (XHR, TS) { XHR = null }
});
},
DownLoadtest: function () {
if (arguments.length != 3) return;
var data = { ajaxMethod: "getforstorage", bookid: arguments[0], chapterid: arguments[1] };
this.AjaxProcess(data, "DownLoadCurChapter", arguments[2],  "Book/BookReader.ashx");
},
GetBookInfo: function () {
if (arguments.length != 2) return;
var data = { ajaxMethod: "getbookinfo", bookid: arguments[0] };
this.AjaxProcess(data, "getbookinfo", arguments[1]);
},
GetVolumeChapter: function () {
if (arguments.length != 3) return;
var data = { ajaxMethod: "getallvolumechapter", bookid: arguments[0], isreadvip: arguments[1] };
this.AjaxProcess(data, "getallvolumechapter", arguments[2]);
}

}

 

posted @ 2013-11-19 18:00  (二少)在南极  阅读(222)  评论(0编辑  收藏  举报