通过按钮,打开一个小窗口,返回值是一数组,然后将数组中的值分别赋给text跟lable,text可以收到,lable怎么收不到啊
这个是小窗口的返回值
strReturnString = " <script language=javascript> " & _
" var ArrTemp = new Array(); " & _
" ArrTemp[0] = '" & strIndexCellOne & "'; " & _
" ArrTemp[1] = '" & strIndexCellTwo & "'; " & _
" ArrTemp[2] = '" & strIndexCellThree & "'; " & _
" window.returnValue = ArrTemp; " & _
" window.close();" & _
" </script> "
Controls.Add(New LiteralControl(strReturnString))这是主窗口的JS
function getEmployee(chbID)
{
var objChb = document.Form1.elements[chbID];
retValue = showModalDialog("BEG0040.aspx?", "", "dialogWidth:650px; dialogHeight:400px; status:0; help:0");
if( retValue == undefined ){
return;
}
if( retValue.length == 0 ){
return;
}
//else
//{
document.Form1.hidEc.value = retValue[0];
objChb.value=retValue[1];
document.Form1.hidOr.value = retValue[2];
//}
}
这个是小窗口的返回值
strReturnString = " <script language=javascript> " & _
" var ArrTemp = new Array(); " & _
" ArrTemp[0] = '" & strIndexCellOne & "'; " & _
" ArrTemp[1] = '" & strIndexCellTwo & "'; " & _
" ArrTemp[2] = '" & strIndexCellThree & "'; " & _
" window.returnValue = ArrTemp; " & _
" window.close();" & _
" </script> "
Controls.Add(New LiteralControl(strReturnString))这是主窗口的JS
function getEmployee(chbID)
{
var objChb = document.Form1.elements[chbID];
retValue = showModalDialog("BEG0040.aspx?", "", "dialogWidth:650px; dialogHeight:400px; status:0; help:0");
if( retValue == undefined ){
return;
}
if( retValue.length == 0 ){
return;
}
//else
//{
document.Form1.hidEc.value = retValue[0];
objChb.value=retValue[1];
document.Form1.hidOr.value = retValue[2];
//}
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="gb2312" lang="gb2312">
<head>
<title> New Document </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="title" content="" />
<meta name="author" content="活靶子,Huobazi,www.AspxBoy.com" />
<meta name="subject" content="" />
<meta name="language" content="gb2312" />
<meta name="keywords" content="" />
<meta name="Copyright" content="www.AspxBoy.com" />
<meta name="robots" content="all" />
<script language="javascript">
function clickMe(){
document.getElementById("lbl").innerText = "Hello world";
}
</script>
</head>
<body><form runat="server">
<asp:label id="lbl" runat="server" Text="我是原来的"></asp:label><button onclick="clickMe()">我是按钮,按我一下</button>
</form></body>
</html>