How to encode a query string so that it is the value of another query string in javascript?
I have a javascript function which passes as a query string value another query string. In other words, I want the query string to be: http://www.somesite.com/?somequery=%3fkey%3dvalue1%2520%26%2520key2%3value3 However, if I redirect like this: var url = ‘http://www.somesite.com/?somequery=’; url += escape(‘?key=value1&key2=value2’); window.location = url; it ends up as http://www.somesite.com?somequery=?key1=value1&key2=value2 in firefox and IE7 which means that I … Read more