How to make HTTP Get request from the ajax part of the JS code?
$.ajax({
type: "POST",
url: "<?= base_url() ?>captcha/checkcaptcha",
global: false,
data: {captcha: captcha},
dataType: 'JSON',
async: false,
success: function (data) {
if (data.error)
{
// GET REQUEST FROM HERE
const http = new XMLHttpRequest();
http.open("GET", "<?= base_url() ?>captcha/error");
http.send();
} else if (data.success)
{
status = true;
}
}
});
return status;
I get in a browser console:
jquery.min.js:4 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.