$.ajax({
url:"/order/pay_order_wx?order_id="+order_id,
type:'GET',
data:"{}",
dataType:"json",
success: function(jsonPayinfo){
console.log('success ==');
if(jsonPayinfo.return_code == 'SUCCESS' && jsonPayinfo.result_code == 'SUCCESS')
{
jsonPayinfo=JSON.stringify(jsonPayinfo);
payLinkShape();
var u = navigator.userAgent;
if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {
//安卓手机
TripMobile.tripPay(payType,jsonPayinfo);
//console.log(payType);
//console.log(jsonPayinfo);
} else if (u.indexOf('iPhone') > -1) {
//苹果手机
//jakilllog(payType,jsonPayinfo);
}
}else{
console.log('进来这里了');
return false;
}
}, error: function (XMLHttpRequest, textStatus, errorThrown) {
console.log(XMLHttpRequest);
console.log(textStatus);
console.log(errorThrown);//打印js对象
var_dump($info); //打印php数组
//错误
console.log('----'+errorThrown);
var_dump('---'.$info);
}
});
})
error方法有3个参数
<input type="button" value="确认并支付" class="sure_pay">
<input type="submit" value="确认并支付" class="sure_pay"> //直接提交.通知执行ajax.但是提交速度快.最后盖过ajax(不执行ajax)
$(".sure_pay").on("touchstart",function(){
$.ajax({
});
})