Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js get url static without path from strin

var pathArray = "https://somedomain.com".split( '/' );
var protocol = pathArray[0];
var host = pathArray[2];
var url = protocol + '//' + host;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #url #static #path #strin
ADD COMMENT
Topic
Name
8+9 =