标题:如何把这个几个数组加到js里面(急啊)谢谢各位了!!
只看楼主
wsyamaha
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2006-3-7
 问题点数:0 回复次数:1 
如何把这个几个数组加到js里面(急啊)谢谢各位了!!

如何把这个几个数组加到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();">&nbsp;
<input type=button name=btngiveup value="放弃最后一桢" onclick="giveupLast();">&nbsp;&nbsp;
<input type=button name=btnnewframe value="下一桢" onclick="newFrame();">&nbsp;&nbsp;
<input type=submit name=submit value="确定" disabled >
</td>
</tr>

<tr>
<td height="2" bgcolor="#0070A2"></td>
</tr>
</table>

</form>

</div>
</body>
</html>

搜索更多相关主题的帖子: js里面 function return Array 
2006-03-14 19:01
linuxpluto
Rank: 4
等 级:贵宾
威 望:13
帖 子:889
专家分:23
注 册:2005-8-14
得分:0 

<?php
echo("<script>")
echo("js代码;php变量$1")
echo("</script")
?>


吃的比猪还差,干的比驴还累,起的比鸡还早,睡得比小姐还晚,挣得比民工还少,看起来比谁都好——苦命的人.人生短短几十年,不要给自己留下了什么遗憾,想笑就笑,想哭就哭,该爱的时候就去爱,无谓压抑自己
2006-03-26 22:09



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-50411-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017088 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved