jquery - get url path?
Posted
by KittyYoung
on Stack Overflow
See other posts from Stack Overflow
or by KittyYoung
Published on 2010-04-19T14:07:34Z
Indexed on
2010/04/19
14:13 UTC
Read the original article
Hit count: 373
I know I can use window.location.pathname to return a url, but how do I parse the url?
I have a url like this: http://localhost/messages/mine/9889 and I'm trying to check to see if "mine" exists in that url?
So, if "mine" is the second piece in that url, I want to write an if statement based on that...
if(second argument == 'mine') { do something }
© Stack Overflow or respective owner