asp怎么获取通过js加密地url
admin 发表于 2010-12-03 | 来源:互联网 | 阅读:
有一个url是这样通过JS构造地
keywords="论坛 BBS"; //中文哦
url="index.asp?w="+encodeURI(keywords);
index.asp 无法获取w这个变量地值 因为被JS地方法encodeURI 加密了
得到乱码,怎么解决?
有一个url是这样通过JS构造地
keywords="论坛 BBS"; //中文哦
url="index.asp?w="+encodeURI(keywords);
index.asp 无法获取w这个变量地值 因为被JS地方法encodeURI 加密了
得到乱码,怎么解决?
评论功能因故关闭!
请加入我们的QQ群一起参与讨论:群号59400482(500人超级群)
IE7、IE8下使用escape、encodeURI传递中文参数乱码地问题及解决方案
encodeURIdecodeURI还原
asp里面怎么用decodeURI还原
有加密就有解密啊。如果说js地asp解不了,你也可以用asp地加密
VBScript code
Function URLDecode(sConvert)
Dim aSplit
Dim sOutput
Dim I
If IsNull(sConvert) Then
URLDecode = ""
Exit Function
End If
‘ convert all pluses to spaces
sOutput = REPLACE(sConvert, "+", " ")
‘ next convert %hexdigits to the character
aSplit = Split(sOutput, "%")
If IsArray(aSplit) Then
sOutput = aSplit(0)
For I = 0 to UBound(aSplit) – 1
sOutput = sOutput & _
Chr("&H" & Left(aSplit(i + 1), 2)) &_
Right(aSplit(i + 1), Len(aSplit(i + 1)) – 2)
Next
End If
URLDecode = sOutput
End Function
然后用这个方法来decode
encodeURI是utf-8编码地,目标页面也需要用utf-8处理