get hostname url by js code example
Example: javascript regex get domain from url
function url_domain(data) {
var a = document.createElement('a');
a.href = data;
return a.hostname;
}
function url_domain(data) {
var a = document.createElement('a');
a.href = data;
return a.hostname;
}