1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- /**
- * 获取数据ajax-get请求
- * @author chanjunkai
- */
- http_ip_port = 'http://47.107.129.126:6639'
- // http_ip_port = 'http://192.168.136.35:8800'
- $.GetJSON = function (url,data,callback){
- $.ajax({
- url:url,
- type:"get",
- contentType:"application/json",
- dataType:"json",
- timeout:10000,
- data:data,
- success:function(data){
- callback(data);
- }
- });
- };
- /**
- * 提交json数据的post请求
- * @author laixm
- */
- $.postJSON = function(url,data,callback){
- $.ajax({
- url:url,
- type:"post",
- contentType:"application/json",
- dataType:"json",
- data:data,
- timeout:60000,
- success:function(msg){
- callback(msg);
- },
- error:function(xhr,textstatus,thrown){
- }
- });
- };
- /**
- * 修改数据的ajax-put请求
- * @author laixm
- */
- $.putJSON = function(url,data,callback){
- $.ajax({
- url:url,
- type:"put",
- contentType:"application/json",
- dataType:"json",
- data:data,
- timeout:20000,
- success:function(msg){
- callback(msg);
- },
- error:function(xhr,textstatus,thrown){
- }
- });
- };
- /**
- * 删除数据的ajax-delete请求
- * @author laixm
- */
- $.deleteJSON = function(url,data,callback){
- $.ajax({
- url:url,
- type:"delete",
- contentType:"application/json",
- dataType:"json",
- data:data,
- success:function(msg){
- callback(msg);
- },
- error:function(xhr,textstatus,thrown){
- }
- });
- };
|