Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript is url

function isWebUrl(string) {
  let url;
  try {
    url = new URL(string);
  } catch (_) {
    return false;  
  }
  return url.protocol === "http:" || url.protocol === "https:";
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #url
ADD COMMENT
Topic
Name
5+4 =