父子傳值
=================父===================================
<script language="javascript">
function openwindow() {
var objName = "<%=Label46.ClientID%>";
var runcard = document.getElementById("<%=txt_pB_1_1.ClientID%>").value;
var url = "data_view.aspx?Obj=" + objName + "&card=" + runcard ;
var name = "新視窗"; //網頁名稱;
var iWidth = "500"; //視窗的寬度;
var iHeight="500"; //視窗的高度;
var iTop = (window.screen.availHeight - 30 - iHeight) / 2; //視窗的垂直位置;
var iLeft = (window.screen.availWidth - 10 - iWidth) / 2; //視窗的水平位置;
window.open(url, name, 'height=' + iHeight + ',,innerHeight=' + iHeight + ',width=' + iWidth + ',innerWidth=' + iWidth + ',top=' + iTop + ',left=' + iLeft + ',status=no,location=no,status=no,menubar=no,toolbar=no,resizable=no,scrollbars=no');
}
</script>
=================子===================================
<script language="javascript">
function funReturn() {
var Obj = "<%=Request["Obj"].ToString()%>";
<%-- var rtnObj = parent.window.opener.document.getElementById(Obj);
rtnObj.value = document.getElementById("<%=TextBox1.ClientID%>").value;--%>
var rtnObj = window.opener.document.getElementById("Label46");
rtnObj.innerText = document.getElementById("<%=TextBox1.ClientID%>").value;
window.close();
}
</script>
沒有留言:
張貼留言