Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js get home url

var base_url = window.location.origin;
var pathArray = window.location.pathname.split('/');
console.log(base_url + '/' + pathArray[1]);
 
PREVIOUS NEXT
Tagged: #js #home #url
ADD COMMENT
Topic
Name
5+9 =