自己发现几个幼稚的错误,改正过来,但是还是提示没有对象,盼望高手帮忙解决
<script type="text/javascript">
function insert(flag)
{
var flow=document.getElementById("lblFlow").value;
var path=new Array();
if(flow!="")
{
path= flow.split(",");
}
var strstep=window.showModalDialog("selectstep.aspx","","status:no;center:yes;scroll:no;resizable:no;help:no;dialogWidth:640px;dialogHeight:480px");
for(int i=flag;;i++)
{
path[i+1]=path[i];
path[flag]=strstep;
}
}
function del(flag)
{
var flow=document.getElementById("lblFlow").value;
var path=new Array();
if(flow!="")
{
path= flow.split(",");
}
for(int i=flag;;i++)
{
path[i]=path[i+1];
}
document.getElementById("lblFlow").value=path;
}
function flowok()
{
var flow=document.getElementById("lblFlow").value;
window.returnValue=flow;
window.close();
}
function flowcancel()
{
window.returnValue="";
window.close();
}
</script>
<script type="text/javascript">
function insert(flag)
{
var flow=document.getElementById("lblFlow").value;
var path=new Array();
if(flow!="")
{
path= flow.split(",");
}
var strstep=window.showModalDialog("selectstep.aspx","","status:no;center:yes;scroll:no;resizable:no;help:no;dialogWidth:640px;dialogHeight:480px");
for(int i=flag;;i++)
{
path[i+1]=path[i];
path[flag]=strstep;
}
}
function del(flag)
{
var flow=document.getElementById("lblFlow").value;
var path=new Array();
if(flow!="")
{
path= flow.split(",");
}
for(int i=flag;;i++)
{
path[i]=path[i+1];
}
document.getElementById("lblFlow").value=path;
}
function flowok()
{
var flow=document.getElementById("lblFlow").value;
window.returnValue=flow;
window.close();
}
function flowcancel()
{
window.returnValue="";
window.close();
}
</script>
大哥js里能这样定义变量呀,js里的类型可都是弱类型的
对象是取不到的,解决的办法之一是可以设个延时:
setTimeout("要执行的程序",5000)
{
path[i+1]=path[i];
path[flag]=strstep;
}
改成
for(i=flag;;i++)
{
path[i+1]=path[i];
path[flag]=strstep;
}
看看