2015-10-05 回答
下边是我做的两个静态的测试页,只要将你的a.asp中的代码变成
<span id="aa">
<%
c="aaaaaaaa"
response.write(c)
%></span>
用javascript从两个页面取值,就是两个窗口的父子关系,都可以做到,但这样做的问题是要两个窗口都存在,即b.html要么是open出来的,要么就是嵌在a.asp的一个div,iframe,或什么东西中.
我曾尝试从a转到b,取a的值,没有成功.
a.html
<html>
<head>
</head>
<script>
function fun(){
var param = "width = 590px,height=420px,menubar = no,toolbar = no,location = no,directries = no,scrollbars = no,status = no,resizable = no, left= 220, top = 150";
window.open("b.html","",param);
}
</script>
<body>
<span id="aa">aaaaaa</span>
<input type="button" value="c" οnclick="fun();">
</body>
</html>
b.html
<html>
<head>
</head>
<script>
function fun(){
document.getelementbyid("a").value= window.opener.document.getelementbyid("aa").innertext;
}
</script>
<body οnlοad="fun();">
<input type="text" id="a" value="">
</body>
</html>