不好用 我是在jsp中将带有+的变量窜给javascript的、
再由javascript刷新一页
再由javascript刷新一页
解决方案 »
- 在HTML中,请问用JS能否实现让一段文字或者图片的超链接在一定时间段内才有效?
- 关于js调用的问题
- 求助:js解析word模板
- 前两位不能为54的正则表达式
- javascript中读取cookie的长度的问题
- |zyciis| Javascript的方法如何写成 MessageBox.Show("哈哈")
- 如何自己定义 JS库(运行在客户端的)。像GOOGLE MAP那样的?
- 脚本不能运行,怎么解决
- 请给我JAVASCRIPT的所有属性和内部函数
- 如何将IE窗口控制到能缩到屏幕右下角,最近好象有这样的技术出现
- javascript中有没有和java中的String.trim()相同功能的函数?
- 思归你好!你的分我已经给你了!可是传递+号还是不行?请执教
<body>
<form method=get >
<input name=a>
<input type=submit value=确定>
</form>
</html>
yourvalue = encodeURIComponent(yourvalue);but it might break some other things
要求 版本 5.5<script>
alert(encodeURIComponent("我+You"))
</script>还是自定义函数吧
<script language="vbscript">
function urlencoding(vstrin)
dim i,strreturn
strreturn = ""
for i = 1 to len(vstrin)
thischr = mid(vstrin,i,1)
if abs(asc(thischr)) < &hff then
'Yang
if thischr="+" or thischr=" " then
strreturn = strreturn & "%" & hex(asc(thischr))
else
strreturn = strreturn & thischr
end if
'End
else
innercode = asc(thischr)
if innercode < 0 then
innercode = innercode + &h10000
end if
hight8 = (innercode and &hff00)\ &hff
low8 = innercode and &hff
strreturn = strreturn & "%" & hex(hight8) & "%" & hex(low8)
end if
next
urlencoding = strreturn
end function
</script>
<script language="javascript">
alert(urlencoding("我+You"))
</script>
=>
if thischr="+" or thischr=" " or thischr="&" or thischr="=" then