javascript fetch html text
// Javascript Fetch for HTML/TEXT
fetch('/about').then(function (response) {
// The API call was successful!
return response.text();
}).then(function (html) {
// This is the HTML from our response as a text string
console.log(html);
// Show result on screen using jQuery
jQuery(function(){
jQuery('.resultLayer').show().html(html);
})
}).catch(function (err) {
// There was an error
console.warn('Something went wrong.', err);
});