The Spaghetti Refactory Established 2015

Simple JavaScript tricks for address bar parsing

Ever wanted to get the current URL using JavaScript?
1
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!)

Tags