asp怎么获取通过js加密地url
admin 发表于 2010-12-03 | 来源:互联网 | 阅读:

有一个url是这样通过JS构造地

keywords="论坛 BBS"; //中文哦

url="index.asp?w="+encodeURI(keywords);

index.asp 无法获取w这个变量地值 因为被JS地方法encodeURI 加密了

得到乱码,怎么解决?

已经有6 个评论
  1. sam950 说:

    IE7、IE8下使用escape、encodeURI传递中文参数乱码地问题及解决方案

  2. ssrq 说:

    encodeURIdecodeURI还原

  3. excomic 说:

    asp里面怎么用decodeURI还原

  4. bocyou 说:

    有加密就有解密啊。如果说js地asp解不了,你也可以用asp地加密

  5. 啊水 说:

    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

  6. yorkie 说:

    encodeURI是utf-8编码地,目标页面也需要用utf-8处理

我要评论

评论功能因故关闭!

请加入我们的QQ群一起参与讨论:群号59400482(500人超级群)


返回首页 | 关于我们 | 联系我们 | 广告合作 | 网站地图 | 友情链接 | 版权声明