先发制人2026
72.36M · 2026-03-22
// 替换指定传入参数的值,oUrl为链接,paramName为参数,replaceWith为新值
function replaceParamVal (oUrl, paramName, replaceWith) {
var re = new RegExp('(' + paramName + '=)([^&]*)', 'gi')
var nUrl = oUrl.replace(re, paramName + '=' + replaceWith)
return nUrl
}