I'm trying to parse a Parameter value from the Query String in JavaScript
E.g URLs:
http://www.contoso.com?key1=value1&key2=value2
http://www.contoso.com?&key2=value2&key1=value1
[window.location.search.substring(0) in JS automatically return portion after '?' so i just need to parse out the key-value]
Result (in both cases)
value1 (If i look up param 'key1')
I have the following in Javascript but it does not work for all
var match = /(?:\?|&)RU=(\S+)(&(\S+)*)/i.exec(window.location.search.substring(0));
Please help
-A