$.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({
});
})
