Spaghetti Refactory
Home
About
Projects
Github
Tuesday, April 7, 2015
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!)
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment