Use javascript to parse URL (not querystring) folder structure domain/parseThis/
I know how to parse the query string but I am getting sent a format of : domainName/variable/somethingElseIDontCareAbout
I need to grab that middle port开发者_如何学运维ion and so I can see what it says... any help?
Thanks! Todd
If your original url is something like http://domainname.com/variable/else
, you can use this:
document.location.href.split("/")[3]
If not, just change the number in the brackets.
精彩评论