Get URL Window Location

var _host = window.location.host; var _href = window.location.href; var _pathName = window.location.pathname; var _lastIndex = _href.substring( _href.lastIndexOf( "/" )+1 ); console.log( '\n\n*******\n\n'+'HOST : '+_host+'\nHREF : '+_href+'\nPATHNAME : '+_pathName+'\nLASTINDEX : '+_lastIndex+'\n\n*******\n\n' );

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.