如何把这个几个数组加到js里面
function ArraySendCount()
{
for($i = 1; $i < 101; $i++)
{
$a[$i] = $i;
}
return $a;
}
function ArraySendLimit()
{
for($i = 1; $i < 1001; $i++)
{
$a[$i] = $i;
}
return $a;
}
$OptionArraySend=Array("是","否");
$OptionArraySC=ArraySendCount();
$OptionArrayL=ArraySendLimit();
?>
<html>
<head>
<title>添加发送地点</title>
<link rel="stylesheet" type="text/css" href="./css.css">
<script type="text/javascript">
function MM_findObj(n, d)
{ //v4.01
var p,i,x;
if(!d)
d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length)
{
d=parent.frames[n.substring(p+1)].document;
n=n.substring(0,p);
}
if(!(x=d[n])&&d.all)
x=d.all[n];
for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n);
return x;
}
function mytest()
{
var obj = MM_findObj("uploaddiv");
alert (obj.innerHTML);
}
document.divid = 1;
document.divheight = 60;
document.backheight = 0;
function checkSubmit ()
{
if (document.divid <= 1)
{
alert("未上传");
return false;
}
document.UploadForm.frmCount.value = (document.divid - 1);
var i = 1;
for (; i < document.divid; i++)
{
var select1 = MM_findObj("send_count" + i);
var select2 = MM_findObj("send_limit" + i);
var select3 = MM_findObj("locus" + i);
var select4 = MM_findObj("enable" + i);
// if (input1.value=="" && input2.innerHTML=="" && input3.value=="")
// {
// alert("发现空桢 #" + i);
// return false;
// }
}
// document.UploadForm.submit();
}
function giveupLast ()
{
if (document.divid <= 1)
return;
document.divid = document.divid - 1;
document.backheight -= document.divheight;
var obj = MM_findObj("div"+document.divid);
obj.outerHTML = "";
obj = MM_findObj("divback");
obj.height = document.backheight > 0 ? document.backheight : 10;
if (document.divid == 1)
document.UploadForm.submit.disabled = "disabled";
}
function giveup ()
{
document.divid = 1;
document.backheight = 0;
var obj = MM_findObj("uploaddiv");
obj.innerHTML = "";
obj = MM_findObj("divback");
obj.height = 10;
document.UploadForm.submit.disabled = "disabled";
}
function newFrame ()
{
if (document.divid > 9)
{
alert("达到最大桢数");
return;
}
document.UploadForm.submit.disabled = 0;
var obj = MM_findObj("uploaddiv");
var oNewNode = document.createElement(""+document.divid);
obj.appendChild(oNewNode);
var curtop = document.divheight * (document.divid-1);
oNewNode.outerHTML = "<div id=div"+document.divid+" style='position:absolute;top:"+curtop
+ "px;visibility:visible;pixelwidth:600;pixelheight:60;z-index:"+document.divid+";'>\n"
+ " <table width=600 border=0 cellspacing=1 cellpadding=0 class=s1>\n"
+ " <tr height=10>\n"
+ " <td colspan=5 bgcolor='#00d9d9'></td>\n"
+ " </tr>\n"
+ " <tr class=s2 valign=bottom height=25 bgcolor=#0070A2>\n"
+ " <td width=135>发送数目</td>\n"
+ " <td width=135>发送条数上限</td>\n"
+ " <td width=135>地点</td>\n"
+ " <td width=135>是否可用</td>\n"
+ " <td width=60>帧数</td>\n"
+ " </tr>\n"
+ " <tr class=s1 valign=bottom bgcolor=Silver>\n"
+ " <td>\n"
+ " <select name=send_count"+document.divid+" style=width:91>\n"
+ " <?=Options($OptionArraySC, 0, 1)?>\n"
+ " </select>\n"
+ " </td>\n"
+ " <td>\n"
+ " <select name=send_limit"+document.divid+" style=width:91>\n"
+ " <?=Options($OptionArrayL, $send_limit, 1)?>\n"
+ " </select>\n"
+ " 条\n"
+ " </td>\n"
+ " <td>\n"
+ " <select name=locus"+document.divid+" style=width:91>\n"
+ " <?=Options($OptionArrayAdd, $locus, 0)?>\n"
+ " </select>\n"
+ " </td>\n"
+ " <td>\n"
+ " <select name=enable"+document.divid+" style=width:91>\n"
+ " <?=Options($OptionArraySend, $enable, 0)?>\n"
+ " </select>\n"
+ " </td>\n"
+ " <td>\n"
+ " #"+document.divid+"\n"
+ " </td>\n"
+ " </tr>\n"
+ " </table>\n"
+ "</div>\n";
document.divid++;
obj = MM_findObj("divback");
document.backheight += document.divheight;
obj.height = document.backheight;
}
</script>
</head>
<body>
<div align="center">
<a class="title1">添加发送地点</a><p>
<form name="UploadForm" method="post" action="handlegrpupload.php" enctype="multipart/form-data" onsubmit="return checkSubmit();">
<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="2" bgcolor="#0070A2"></td>
</tr>
<tr>
<td>
<table width=100% border=0 cellspacing=1 cellpadding=0 class=s1>
<tr>
<td bgcolor="#999999" align="center" height="25" style="font-size:12px ">添加发送地点</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<div id="uploaddiv" style="position:absolute; z-index:1; width:700px; height:10px; border: 0px groove #000066; overflow: visible;">
</div>
</td>
</tr>
<tr>
<td id=divback height="10">
</td>
</tr>
<tr>
<td align=center>
<input type=hidden name=frmCount value="0">
<input type=hidden name=catalogid value="53">
<input type=button name=btngiveup value="全部放弃" onclick="giveup();">
<input type=button name=btngiveup value="放弃最后一桢" onclick="giveupLast();">
<input type=button name=btnnewframe value="下一桢" onclick="newFrame();">
<input type=submit name=submit value="确定" disabled >
</td>
</tr>
<tr>
<td height="2" bgcolor="#0070A2"></td>
</tr>
</table>
</form>
</div>
</body>
</html>