Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

find base url in javascript

var base_url = window.location.origin;

var host = window.location.host;

var pathArray = window.location.pathname.split( '/' );
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #base #url #javascript
ADD COMMENT
Topic
Name
9+5 =