Possible Duplicate:
Use the get parameter of the url in javascript
Suppose I have this url:
s = 'http://mydomain.com/?q=microsoft&p=next'
In this case, how do I extract "microsoft" from the string? I know that in python, it would be:
new_s = s[s.find('?q=')+len('?q='):s.find('&',s.find('?q='))]