Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript regex get domain from url

function url_domain(data) {
  var    a      = document.createElement('a');
         a.href = data;
  return a.hostname;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #regex #domain #url
ADD COMMENT
Topic
Name
1+5 =