日期:2014-05-16  浏览次数:20403 次

a文件内容输去b文件,请看看代码哪里出错!!急急
130a文件代码在下:
JScript code

<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
<form name="myForm">
    <input type="text" name="myField">
</form>
</body>
</html>



130b文件代码在下:
JScript code

<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script language="javascript">
function newWin() {
    var
    newWindow = window.open("130a.html","newWindow");
    }
</script>

</head>

<body>
<script language="javascript">
function nAl() {    
    var
    nAlert = window.alert(newWindow.document.myForm.myField.value);
    }
</script>
    <a href="#" onClick="nAl()">Click me </a>
</body>



本人想把130a的内容输去130b,
之后跳出提示以显示130a的内容。

------解决方案--------------------
<script language="javascript">
function newWin() {
var newWindow = window.open("130a.html","newWindow");
return newWindow
}
</script>
</head>
<body>
<script language="javascript">
function nAl() {
var x=newWin();
alert(x.document.forms[0].elements[0].value);
}
</script>
<a href="#" onClick="nAl()">Click me </a>
130b页面改成这样试试 貌似ie倒是可以 火狐不行啊 哈