但我看不懂,能给解释一下么?
unescape是什么?
这一串:%3Cscript%3Edocument.oncontextmenu%3Dnew%20Function%28%22event.returnValue%3Dfalse%22%29%0D%0Adocument.onselectstart%3Dnew%20Function%28%22event.returnValue%3Dfalse%22%29%3C/script%3E 又是什么?
???????
unescape是什么?
这一串:%3Cscript%3Edocument.oncontextmenu%3Dnew%20Function%28%22event.returnValue%3Dfalse%22%29%0D%0Adocument.onselectstart%3Dnew%20Function%28%22event.returnValue%3Dfalse%22%29%3C/script%3E 又是什么?
???????
是一种加密字符的算法吧
escape 方法 描述
对 String 对象编码以便它们能在所有计算机上可读,
语法
escape(charstring)
charstring 参数是要编码的 String 对象。 说明
escape 返回一个包含了 charstring 内容的新的 String 对象( Unicode 格式), 所有空格、标点、重音符号以及其他非 ASCII 字符都用 %xx 编码代替,其中 xx 等于表示该字符的十六进制数。 例如,空格返回的是 "%20" 。
字符的值大于 255 的用 %uxxxx 格式存储。
解密也很容易,baidu一下就行了
只是得注意某些特殊字符,比如</script>,直接用在js的字符串里会有问题,得变动一下:var a="</script>";//此句错误--->>>var b="<\/script>";