I'm trying to use .replace() to replace a specific part of a URL but I'm not sure how to go about it.
Specifically, I'm taking a string that looks like this:
'param1=www.DOMAIN.NAME¶m2=NUM1¶m3=true¶m4=25'
I'd like to change param2 at my own discretion using jquery.
Currently I just use .replace('NUM1', newParam);
but as you can see once 'NUM1'
changes to the new parameter that the varaible newParam
gives it, I can't then change it again as it will no long find 'NUM1'
.