Simple JavaScript tricks for address bar parsing
Ever wanted to get the current URL using JavaScript?
window.location.href
You can also retrieve various pieces of it by replacing
.href
with .host
, .protocol
, or .pathname
. (Thanks to CSS-tricks.com for the tips!)