html js 后台返回图片条形码二维码
<body>
    <button id="SubmitButton">点击跳转</button>
    <img src="" alt="条形码" id="BarCode" />
<img src="" alt="二维码" id="QRCode" />

 

=========================================================

          url: "/Mobile/AppointActivity/AppointActivityMbHandler.ashx?type=CreateBarCodeAndQRCode",                            
                            type: "post",
                            data: {
                                "BID": '<%=encBID%>',//商户BID
                                "ApOrderID": "O20180110145126184320" //预约子订单号
                            },
                            success: function (obj) {
                                    var obj = JSON.parse(obj);
                                    if (obj.code == "1") {
                                    alert("成功");
                                    if (obj.msg = "获取图片成功") {
                                        $('#BarCode').attr('src', obj.data["BarCode"]);
                                        $('#QRCode').attr('src', obj.data["QRCode"]);
                                    }
                                    return;
                                }
                            },
                            error: function () {
                                alert("失败");
                            }
                        })
                        //alert("ajax完成");
                    })
                })
            </script>

 

posted on 2022-09-20 16:19  Jankie1122  阅读(64)  评论(0编辑  收藏  举报