parsing - Use javascript to parse URL (not querystring) folder structure domain/parseThis/ -


I know how to parse the query string but I'm sending a format of: domainName / variable / somethingElseIDontCareAbout

I need to catch that middle part and so I can see what it says ... any help?

Thank you! Todd

If your original URL is something like http://domainname.com/variable/ Else , you can use it:

  document.location.href.split ("/") [3]   

if No, just change the number in the brackets.

Comments

Popular posts from this blog

php - Creating canonical URLs with custom route-classes -

asp.net mvc 3 - How to determine why unobtrusive validation is not working -

vba - How to assign paragraph / character styles automatically in word 2010 -