How to Parse URL in JavaScript: hostname, pathname, query, hash

How to easily parse URL in JavaScript and access components like hostname, pathname, query, or hash.

How to easily parse URL in JavaScript and access components like hostname, pathname, query, or hash.
Print Share Comment Cite Upload Translate
CITATION GOES HERE CITATION GOES HERE
Select a language: