Hey everyone, I'm new here and hoping to get some help with an issue I'm facing. I've written a code to fetch data from an API and display it on my HTML page, but for some reason the AJAX code isn't working. There's nothing showing up in the console except for a warning from Chrome:
[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check .
Here is the AJAX code I am using, can someone please point out what I might be doing wrong?
$.ajax
({
type: "GET",
url: "xxxxxxxxxx",
dataType: 'json',
async: false,
username: "xxxxxxx",
password: "xxxxxxxxxx",
data: '{ "id" }',
success: function (){
alert('Thanks for your comment!');
}
});