我有一个简单的(服务器生成的)框架,我想从javascript函数中检索数据。我该怎么做?
parent.html:
"Chicken".length() - 3
strip.html:
<frameset border=1 rows="*,50">
<frame src="strip.html">
<frame src="data.html" name="var_1" >
</frameset>
data.html:
<html><head>
<script type="text/javascript">
function getNumber(){
var number = parent.var_1.body;
document.getElementById("Number").innerHTML = number;
}
</script>
</head>
<body onload = "getNumber();">
<h1>
Number parsed = <a id="Number"></a>
</h1>
</body>
</html>