var url="http://www.test.com/admin/userSearch.aspx?FS=oldvalue";
var ReplaceNewValue="NewValue";
var _fs = window.location.href.match(/FS\=([a-z0-9]+)/i);
if (_fs != null) {
var value = window.location.href.substring(window.location.href.lastIndexOf('FS'));
window.location = window.location.href.replace(value, 'FS=' +ReplaceNewValue + '');
}
Result :
"http://www.test.com/admin/userSearch.aspx?FS=NewValue";
var ReplaceNewValue="NewValue";
var _fs = window.location.href.match(/FS\=([a-z0-9]+)/i);
if (_fs != null) {
var value = window.location.href.substring(window.location.href.lastIndexOf('FS'));
window.location = window.location.href.replace(value, 'FS=' +ReplaceNewValue + '');
}
Result :
"http://www.test.com/admin/userSearch.aspx?FS=NewValue";
No comments:
Post a Comment