@newbiz/sohomall-libs
Version:
신사업개발실 원더FE개발팀 소호몰 전용 라이브러리
31 lines (30 loc) • 919 B
JavaScript
function makeshopCouponDownload(couponNum, brandCode) {
if (window.jQuery || $) {
$(function () {
$.ajax({
type: 'POST',
url: '/shop/download_coupon.ajax.html',
dataType: 'html',
async: false,
data: {
type: 'coupon',
couponnum: couponNum,
brandcode: brandCode,
r: Math.random(),
},
})
.then(function (req) {
var flag = req.substring(0, 1);
var msg = req.substring(2);
window.alert(msg);
if (flag === 'Y') {
window.location.href = '/m/login.html';
}
})
.catch(function () { });
});
}
else {
console.error('jQuery was not loaded!');
}
}