+-符号传递不了吗?

MeChecksV 2008-04-11 11:44:09
<%response.Write(request("string"))%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<input value="test" name="test" type="button" onclick="testcs()" />
</body>
</html>
<script>
function testcs(){
var string="test +/2";
location="test06.asp?string="+string;
}

</script>

得不到+号 如何可以得到?
...全文
57 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
hookee 2008-04-11
  • 打赏
  • 举报
回复
+号会被解释为空格
var string="test +/2";
location="test06.asp?string=" + encodeURIComponent(string);
Mapleleaf123 2008-04-11
  • 打赏
  • 举报
回复
%2B +


%2D -
deleteall8 2008-04-11
  • 打赏
  • 举报
回复
function testcs(){ 
var string="test +/2";
location="test06.asp?string="+escape(string);
}

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧