I got a URL like this:
http://google.de/test.php?a=b&c=d&e=f
I know got to modify just one of the GET params like this: (c is “h” instead of “d”)
http://google.de/test.php?a=b&c=h&e=f
and redirect to the new url. All other GET params should stay the same.
How am I going to do this?
I agree its best to use a library for this purpose as mentioned in other answers.
However, here is a string replacement solution based on regular expressions if you need a simpler quick fix.
Here I’m replacing the query string key ‘z’ with ‘newVlaue’
Have a look at this fiddle: http://jsfiddle.net/BuddhiP/PkNsx