可执行ajax (基于java1.8)

$.ajax({
type: "POST",
url: "",
data: JSON.stringify(jsonData),
success: function (res) {
// 如果返回的值并不是0,则进行数据显示
if (res.msg != '0') {
$("#qrcode img").remove();
var qrcode = new QRCode(document.getElementById("qrcode"), {
width : 180,
height : 180});
qrcode.makeCode(res.msg);

} else {
$("#qrcode").append("<p style=\"margin: 15px 0;font-size: 15px\">生成订单二维码失败!</p>");
console.log(res.msg);
}
},
error:function(arg1){
console.log(arg1)
},
contentType: "application/json;charset=GBK",
dataType: "json"
});

猜你喜欢

转载自www.cnblogs.com/setname/p/12340246.html
今日推荐