1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
jQuery.ajx = function(url, data, async, type, dataType, successfn, errorfn) { async = (async == null || async == "" || typeof(async) == "undefined") ? "true" : async; type = (type == null || type == "" || typeof(type) == "undefined") ? "get" : type; dataType = (dataType == null || dataType == "" || typeof(dataType) == "undefined") ? "json" : dataType; data = (data == null || data == "" || typeof(data) == "undefined") ? { "date": new Date().getTime() } : data; $.ajax({ type: type, async: async, data: data, url: url, dataType: dataType, contentType: "application/json", success: function(data,status) { successfn(data,status); }, error: function(xhr,err) { errorfn(xhr,err); } }); };
|