一个页面中,一个分帧提取另一分帧中数据的问题,在线等待!!急!
为什么出错,在dengyu.jsp中t1为什么不能得到数值!!!!
我能不能在form1.jsp中调用dengyu.jsp中定义的addTD().
<html>
///form1.jsp
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>暗暗啊</title>
<form name="form1" METHOD=POST action="dengyu.jsp">
<INPUT TYPE="text" name="text1">
</form>
</body>
</html>
////dengyu.jsp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>浏览</title>
</head>
<body>
<%@page contentType="text/html; charset=gb2312"%>
<script language='javascript'>
function addTD(){
var t1=window.parent.top.form1.text1.value;
var t2="aaaa";
var t3="wojeir";
var table = sampleTable;
var tbody = sampleTable.firstChild;
var tr = document.createElement("TR");
var td1 = document.createElement("TD");
var td2 = document.createElement("TD");
var td3= document.createElement("TD");
td1.appendChild(document.createTextNode(t1));
td2.appendChild(document.createTextNode(t2));
td3.appendChild(document.createTextNode(t3));
tr.appendChild(td1);
tr.appendChild(td2);
tr.appendChild(td3);
tbody.appendChild(tr);
}
</script>
<table id='sampleTable' width="500" border="1" cellspacing="0" cellpadding="0">
</table>
<INPUT TYPE="button" value="确定" onClick="addTD()">
</body>
</html>
/////main.htm
<html>
<head>
<title>
</title>
</head>
<frameset rows="50%,*">
<frame name="top" src="form1.jsp" noresize target ="down" scrolling="auto">
<frame name="down" src="dengyu.jsp" scrolling="auto">
</frameset>
</html>