Answers for "check if url is valid"

-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
0

Best way to check if a URL is valid

filter_var($url, FILTER_VALIDATE_URL);

if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) {
    die('Not a valid!!');
}
Posted by: Guest on October-07-2021
-1

validate url in javascript

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

validate url javascript

validateurl
Posted by: Guest on May-19-2021

Code answers related to "check if url is valid"

Code answers related to "Javascript"

Browse Popular Code Answers by Language