怎么可以让父窗口得到IFRAME中的数据..~

来源:互联网 发布:电话销售数据在哪里买 编辑:程序博客网 时间:2024/04/26 10:46
//test.aspx

<html>
<head>
<title>test</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<iframe width=430 height=420 id="ifrm1" name="ifrm1" src=frm.htm>
</iframe>
<asp:TextBox ID="tx" Text="1111" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>


//frm.htm

<head>
<script >
function passdata(str)
{
window.parent.document.getElementById("tx").value = str;
}
</script>
<head>

<body>
<form id="from1" name="from1">

<span style="font-family:Arial; font-size:12px;">昵称:<input type="text" id="nick" name="nick"/></span>

<input type="button" id="subbtn" name="subbtn" value="提交" onclick="passdata(document.getElementById('nick').value)" />

</form>
</body> 
原创粉丝点击