日期:2014-05-16  浏览次数:20297 次

求教大家帮我修改我这个错误(应该很简单,因为我不懂js)
<html> <head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />
<title> 无 </title> </head>
<script   language= "javascript ">
var   my_array=   new   Array(6);
my_array[0]=1917;
my_array[1]=4218;
my_array[2]=5723;
my_array[3]=6712;
my_array[4]=7807;
my_array[5]=7884;
i=-1;
index=1917;
document.write( " "+index+ " ");
</script>
<BODY>
<FORM   name=send_form   id=send   action=/send.asp?id=3183   method=post   target=send_frame>
<INPUT   id=title   maxLength=200   value=哈哈   name=subject>
<br> <textarea   id=text   name=contents   rows=9   cols=100   align=center>
内容 </textarea>
<INPUT   type=submit   value=发送   id=sb   onClick= "next() "> </FORM>
<iframe   name=send_frame   width= "100% "   height= "300 "> </iframe>
</BODY>
<script   language= "javascript ">
<!--  
function   a(){  
document.getElementsByName( "send_form ")[0].action   = "send.asp?id=1917 ";  
}  
//-->
</script>
<script   language= "javascript ">  
var   i=0;  
function   next(){  
i++;  
}  
</script>
</html>


我想让他实现点击发送
第1次,发给send.asp?id=1917
第2次,发给send.asp?id=4218
第3次,发给send.asp?id=5723
第4次,发给send.asp?id=6712
。。。。。。。。。。。。。

知道全部发完为止

我问了别人,改了一些,但还是不对,请帮我改正确吧~~~~我都整了好几天了,找不到人完整的回答。。。。。。。。。。。。。。。郁闷

------解决方案--------------------
<html> <head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<title> 无 </title> </head>
<script language= "javascript ">

var i=0;
var my_array= new Array(6);
my_array[0]=1917;
my_array[1]=4218;
my_array[2]=5723;
my_array[3]=6712;
my_array[4]=7807;
my_array[5]=7884;

function next(){
if(i==my_array.length){
alert( "发送完毕 ");
return;
}
document.getElementsByName( "send_form ")[0].action= "send.asp? "+my_array[i];
document.getElementsByName( "send_form ")[0].submit();
i++;
}
</script>
<BODY>
<FORM name=send_form id=send action=/send.asp?id=3183 method=post target=send_frame>
<INPUT id=title maxLength=200 value=哈哈 name=subject>
<br> <textarea id=text name=contents rows=9 cols=100 align=center>
内容 </textarea>
<INPUT type=button value=发送 onclick= "next() "> </FORM>
<iframe name=send_frame width= "100% " height= "300 "> </ifrme>
</body>
</html>