function updateQuerystring(str, itemToReplace, value) { if (str != null) { var pairs = str.split('&'); $.each(pairs, function (i, v) { if (v.indexOf(itemToReplace) >= 0) { pairs[i] = itemToReplace + "=" + value; } }); str = ''; $.each(pairs, function (i, v) { if (pairs[i].indexOf("?") >= 0) str = pairs[i]; else str = str.concat("&" + pairs[i]); }); } return str; }
Friday, October 5, 2012
Update an item of a querystring using Jquery
Labels:
QueryString update in jquery
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment