Got this to work.
I will just remove the parameters and the values if they are present in the url. Then run the logic to create and add the paramters and there values to the url, if they are needed.
url = “http://www.daniweb.com?parm1=value&parm2=value&parm3=value&parm4=value
var urlParm3loc = url.search(/&parm3=/);
var urlParm4loc = url.search(/&parm4=/);
if(urlParm3loc > 0 || urlParm4loc > 0)
{
var startIndex = urlParm3loc > urlParm4loc ? urlParm4loc : urlParm3loc ;
url = url.replace(url.substring(startIndex,url.length),"");
}
Reputation Points: 13
Solved Threads: 2
Junior Poster in Training
Offline 88 posts
since Aug 2005