首页 > Web开发 > 详细

ajax封装使用

时间:2015-03-22 01:37:06      阅读:404      评论:0      收藏:0      [点我收藏+]

$.ajax({
type: "POST",
url: "some.php",
data: "name=John&location=Boston",
dataType : ‘text‘,
async : false,
success: function(msg){
alert( "Data Saved: " + msg );
}
});

 

var ACT.ajax = function(data){
var result_msg = ‘‘;
this.opts = {
type : data.type,
url : data.url,
data: data.data,
dataType : text,
async : false,
success : function(data){

}
}

$.ajax({
type: opts.type,
url: opts.url,
data: opts.data,
dataType : opts.dataType,
async : false,
success: function(msg){
result_msg = msg;
}
});

this.success = function(){
return result_msg;
}
}


var t = new ACT.ajax();

 

ajax封装使用

原文:http://www.cnblogs.com/yudishow/p/4356609.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!