Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript get domain name from string

const url = 'https://www.mydomain.com/blog?search=hello&world';
const domain = (new URL(url)).hostname.replace('www.','');
Source by www.michaelburrows.xyz #
 
PREVIOUS NEXT
Tagged: #javascript #domain #string
ADD COMMENT
Topic
Name
3+2 =