JSFiddle - React, Tailwind, and code Playground

by Serge Zahharenko

JavaScript

function UrlExists(url) {
  var http = new XMLHttpRequest();
  http.open('HEAD', url, false);
  http.send();
  return http.status != 404;
}

UrlExists('http://www.mozilla.eee');