How do I do the following?
I have the following url
http://www.example.com/example/test/search
How do I get the "test" from the url using the javascript?
I would like to have a function that I call q = getUrlVars() and when I do q[1] it should give me the "test" (or parameter after second slash) from the url.
I am new to javascript. I know regex expressions is the way to get started, but I am not sure how to use that to get what I need. Thanks!