javasript在网页中 传多个值

haonanernet 2005-04-24 12:46:35
<script language=javascript>
function test(num)
{
var http = new ActiveXObject("Microsoft.XMLHTTP");
http.open("GET","http://www.....net/.../.....php?mobile="+num,false);
http.send();
}
<script>


主要想把下面的三个值穿到   http://www.....net/.../.....php?
上面那个函数只能传一个值,如果我要传三个值过去,怎么写?

还有就是我怎么样去调用这个传值函数,因为我要传的是
<input type="text" name="mobilecode" value="<%=a(cint(rs.recordcount))%>">
<input type="text" name="mobilename" value="<%=strname%>">
<input type="text" name="mobileid" value="<%=c%>">

...全文
97 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
jzywh 2005-04-24
  • 打赏
  • 举报
回复
写错了 & -> +


http.open("GET","http://www.....net/.../.....php?mobile="+num+"¶2="+ para2 + "¶3=" + para3,false);
jzywh 2005-04-24
  • 打赏
  • 举报
回复
http.open("GET","http://www.....net/.../.....php?mobile="+num+"¶2="& para2 & "¶3=" & para3,false);
jzywh 2005-04-24
  • 打赏
  • 举报
回复
用post可以
jzywh 2005-04-24
  • 打赏
  • 举报
回复
<script language=javascript>
function test(num)
{
document.all("form1").submit();
}
<script>


<form name="form1" action="http://www.....net/.../.....php" method="post">
<input type="text" name="mobilecode" value="<%=a(cint(rs.recordcount))%>">
<input type="text" name="mobilename" value="<%=strname%>">
<input type="text" name="mobileid" value="<%=c%>">
</form>
haonanernet 2005-04-24
  • 打赏
  • 举报
回复
大哥,对方网页给了我三个值?no1=...&no2=...&no3=...
是get把
  • 打赏
  • 举报
回复
你不清楚对方网页传值的接收方式??
  • 打赏
  • 举报
回复
var thenum=document.getElementsByName("mobilecode");
var thename=docuemnt.getElementsByName("mobilename");
var theid=document.getElementsByName("mobileid");
name=thename(0).value;
num=thenum(0).value;
id=theid(0).value;
三个值就得到了
haonanernet 2005-04-24
  • 打赏
  • 举报
回复
1如果是表单提交,则直接在test方法中获取字段的值。
我想用表单提交啊,但是现在是传值到其他网站的页面
所以怎么能获得值呢?
或者请问怎么传值呢
2function test(num,name,code),
<input type="text" name="mobilecode" value="<%=a(cint(rs.recordcount))%>">
<input type="text" name="mobilename" value="<%=strname%>">
<input type="text" name="mobileid" value="<%=c%>">

上面三个如何传到那个test函数呀
  • 打赏
  • 举报
回复
那要看你php页面怎么接收的了

楼上的方法挺对的啊,如果是get型的接收的话
newskyline 2005-04-24
  • 打赏
  • 举报
回复
1、可以在test的参数中多加两个,如function test(num,name,code),然后"http://www.....net/.../.....php?mobile=" + num + "&name=" + name + "&code=" + code;
2、如果是表单提交,则直接在test方法中获取字段的值。

28,390

社区成员

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

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