Xử lý callback function khi server đéo bật CORS
Xem ở đây: https://www.sencha.com/forum/showthread.php?299915-How-to-make-an-ajax-request-cross-origin-CORS
Đoạn code đấy ở đây:
$.ajax({
url: 'http:ww.abc.com?callback=?',
dataType: 'JSONP',
jsonpCallback: 'callbackFnc',
type: 'GET',
async: false,
crossDomain: true,
success: function () { },
failure: function () { },
complete: function (data) {
if (data.readyState == '4' && data.status == '200') {
errorLog.push({ IP: Host, Status: 'SUCCESS' })
}
else {
errorLog.push({ IP: Host, Status: 'FAIL' })
}
}
});
PreviousSms Provider For Two-factor authenticationNextAngular6.1 công bố chính thức tháng 7 năm 2018
Last updated