Ajax
Como.Ajax对象,执行异步请求操作
ajax text xml json Model
ajax
执行ajax请求,返回XMLHttpRequest对象
Como.Ajax.ajax(url,{
	method: 'get',			//请求方式,post or get(默认)
	format: 'json',			//返回的格式, text or xml or json(默认)
	encode: 'UTF-8',		//请求的编码, UTF-8(默认)
	async: true,			//是否异步,true(默认)
	data:	null,			//参数
	success: function(data){},	//请求成功后执行
	failure: function(http){}	//请求失败后执行
});
text
执行ajax请求,返回格式为text
Como.Ajax.text(url,{
	method: 'get',
	encode: 'UTF-8',
	data:	null,
	success: function(data){},
	failure: function(http){}
});
xml
执行ajax请求,返回格式为xml
Como.Ajax.xml(url,{
	...
});
json
执行ajax请求,,返回格式为json
Como.Ajax.json(url,{
	...
});
 
Ajax.Model
一次配置多个ajax请求,返回对象,易扩展,方便操作与管理
声明
var test = new Como.Ajax.Model({
	add:{
		url:	'add.do'	//Ajax请求地址
		params:	['name', 'age']	//参数名数组
		method:	 'get'		//请求模式
		format:	'json'		//返回格式
		cache:	 false		//是否加上时间戳ts,避免服务器缓存结果
	},
	del:{
		...
	}
});
使用
test.add({
	name: 'yanyun',
	age:	'24'
}, {
	success: function(data){},
	failure: function(http){}
})