What is the difference between typical AJAX and Fetch API?
Consider this scenario:
function ajaxCall(url) { return new Promise(function(resolve, reject
Your ajaxCall is returning the responseText from the XMLHttpRequest object. It is filtering it out.
You need to read the response Text in the fetch code.
fetch('/foo/').then(x => x.text()).then(console.log)
You can also use x.json() or x.blob()
x.json()
x.blob()