mirror of
https://github.com/wu736139669/vczero.github.io.git
synced 2026-08-05 06:23:38 +00:00
33 lines
507 B
JavaScript
33 lines
507 B
JavaScript
/*
|
|
* 作者:wlhmyit@126.com
|
|
* 时间:2014-10-09
|
|
* 描述: ajax GET & POST封装
|
|
* */
|
|
define(function(require, exports, module){
|
|
|
|
var get = function(path, callback, query){
|
|
$.get(path, query, function(json){
|
|
return callback(json);
|
|
}, 'json');
|
|
|
|
};
|
|
|
|
|
|
var post = function(path, data, callback){
|
|
$.post(path, data, function(json){
|
|
if(json){
|
|
return callback(json);
|
|
}
|
|
return {
|
|
status: 0
|
|
};
|
|
});
|
|
};
|
|
|
|
module.exports = {
|
|
get: get,
|
|
post: post
|
|
};
|
|
|
|
});
|