function changeURLArg(url,arg,arg_val){ var pattern=arg+'=([^&]*)'; var replaceText=arg+'='+arg_val; if(url.match(pattern)){ var tmp='/('+ arg+'=)([^&]*)/gi'; tmp=url.replace(eval(tmp),replaceText); return tmp; }else{ if(url.match('[\?]')){ return url+'&'+replaceText; }else{ return url+'?'+replaceText; } } }
修改url中某个参数
猜你喜欢
转载自www.cnblogs.com/Neilisme/p/10878185.html
今日推荐
周排行