Answers for "how to check whether url is responding or not in typescript"

0

how to check whether url is responding or not in typescript

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;
  });
});
Posted by: Guest on October-29-2021
0

how to check whether url is responding or not in typescript

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;
  });
});
Posted by: Guest on October-29-2021

Code answers related to "how to check whether url is responding or not in typescript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language