日期:2014-05-17 浏览次数:21196 次
s = "http://127.0.0.1/index.asp?aaa&bbb=2&ccc=3"
response.write removeQueryParam(s, "bbb")
function removeQueryParam(s, p)
ar = split(s,"?")
if ubound(ar) = 0 then
removeQueryParam = s
else
QueryString = ar(1)
ar2 = split(QueryString, "&")
for i=0 to ubound(ar2)
if left(ar2(i), len(p)+1) = p & "=" or ar2(i) = p then
ar2(i) = ""
end if
next
removeQueryParam = Join(ar2, "&")
removeQueryParam = replace(removeQueryParam, "&&", "&")
if left(removeQueryParam, 1) = "&" then
removeQueryParam = right(removeQueryParam, len(removeQueryParam)-1)
end if
end if
end function