mui.ajax()方法,get请求
前端页面:
测试
点击测试
mui.init();
mui.plusReady(function(){
document.getElementById('btn1').addEventListener('tap',function(){
mui.ajax({
url : 'http://m.baoxianbox.cn/index.php?m=Home&c=Index&a=ceshi',
type : 'GET',
success : function(data){
mui.toast(data);
},
error : function(xhr,type,errorThrown){
mui.toast(type);
}
});
});
});
后端thinkphp控制新直能分支调二浏页器朋代说,器中
public function ceshi(){
if(IS_GET){
//$data=M('ping')->select();
$data='你好';
$this->ajaxReturn($data,'json');
$this->display();
}
}
本文来源于网络:查看 >https://www.cnblogs.com/yinmeng/p/7232132.html