楼主,看看下面的代码是不是你要的:index.html
<html>
<head>
<script>
/*
//For FF
function add(){
var param1 = document.getElementById('param1').value;
var param2 = document.getElementById('param2').value;
var iObj = document.getElementById('iResultFrame').contentDocument;
iObj.getElementById('result').value=parseFloat(param1)+parseFloat(param2);

*/
//For IE
function add(){
var param1 = document.getElementById('param1').value;
var param2 = document.getElementById('param2').value;
document.frames["iResultFrame"].document.getElementById('result').value=parseFloat(param1)+parseFloat(param2);

</script>
</head>
<body onload="add()">
<form method="get" target="document.">
<input id="param1"></input>
<input id="param2"></input>
<input type="button" value="Add" onclick="add()"/>
</form>
<iframe id="iResultFrame" frameborder="1" align="right" src="./iframe.html">
</iframe>
</body>
</html>iframe.html<html>
<head>
</head>
<body>
This is the result:<input id="result" value="0"/>
</body>
</html>
注意,对于IE和FF访问Iframe的方法是不同的(我已经做了注释),请按照不同的浏览器需求,选择add()函数。