Js callBack 返回前一页的js方法
人气:0
从页面a.html到页面b.html
a.html
<html>
<head>
<title>a</title>
<script language = "javascript">
function callBack(){
alert("Come back !");
}
</script>
</head>
<body>
<a href="b.html">去b页面</a>
</body>
</html>
b.html
<html>
<head>
<title>b</title>
<script language = "javascript">
function goB(){
window.opener.callBack();
}
</script>
</head>
<body>
<a href="#" onClick="javascript:goB();">返回a页面</a>
</body>
</html>
a.html
复制代码 代码如下:
<html>
<head>
<title>a</title>
<script language = "javascript">
function callBack(){
alert("Come back !");
}
</script>
</head>
<body>
<a href="b.html">去b页面</a>
</body>
</html>
b.html
复制代码 代码如下:
<html>
<head>
<title>b</title>
<script language = "javascript">
function goB(){
window.opener.callBack();
}
</script>
</head>
<body>
<a href="#" onClick="javascript:goB();">返回a页面</a>
</body>
</html>
加载全部内容