Answers for "how to check for the valid url format in javascript"

-1

javascript determine if string is valid url

function isValidHttpUrl(string) {
  let url;
  
  try {
    url = new URL(string);
  } catch (_) {
    return false;  
  }

  return url.protocol === "http:" || url.protocol === "https:";
}
Posted by: Guest on February-05-2021
-1

validate url in javascript

validate url
Posted by: Guest on May-19-2021

Code answers related to "how to check for the valid url format in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language