how to check whether url is responding or not in typescript

The solution for “how to check whether url is responding or not in typescript” can be found here. The following code will assist you in solving the problem.

var myImage = document.querySelector(‘img’);

var myRequest = new Request(‘flowers.jpg’);

fetch(myRequest).then(function(response) {
console.log(response.ok); // returns true if the response returned successfully
response.blob().then(function(myBlob) {
var objectURL = URL.createObjectURL(myBlob);
myImage.src = objectURL;
});
});

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in