How can I address and obtain the correct status code for this Ajax code? In the latest version of Chrome, it returns a status code of 404, while in Edge and the older version of Chrome, it returns a normal 200.
<script>
const url = 'https://www.google.com';
$.ajax({
url: url,
dataType: "jsonp",
cache: false,
timeout: 10000,
complete: function (xhr, textStatus) {
console.log('HTTP Status Code:', xhr.status);
console.log('Request Status:', textStatus);
}
});
</script>
How to Resolve?How to Resolve?