
mui框架基于htm5plus的XMLHttpRequest,封装了常用的Ajax函数,支持GET、POST请求方式,支持返回json、xml、html、text、script数据类型; 本着极简的设计原则,mui提供了mui.ajax方法,并在mui.ajax方法基础上,进一步简化出最常用的mui.get()、mui.getJSON()、mui.post()三个方法。
详细请看这篇文章:http://www.bcty365.com/content-146-2390-1.html
举个简单的例子:
var address_url=htts+'mobile/index.php?act=member_address&op=address_list'
mui.post(address_url,{key:ukey},function(data){
var address_list=data.datas.address_list||{}
for(var i=0i<address_list.lengthi++)
{
if(address_id==address_list[i].address_id)
{
address_html='<a class="mui-navigate-right" onclick="add_new_address()">'
address_html+='<span>姓名:'+address_list[i].true_name+'</span>'
address_html+='<span class="xxdz">详细地址:'+address_list[i].area_info+' '+address_list[i].address+'</span>'
address_html+='<span>联系电话:'+address_list[i].mob_phone+'</span>'
address_html+='</a>'
document.querySelector('#shrxx').innerHTML=address_html
document.querySelector('input[name="address_id"]').value=address_list[i].address_id
document.querySelector('input[name="area_id"]').value=address_list[i].area_id
document.querySelector('input[name="city_id"]').value=address_list[i].city_id
offpay()
}
}
},'json')
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)