获的连接

ahui_net 2002-03-14 12:16:46
我在一个页面上打开了一个页面,
然后打开的页面有可能不停的点击,
然后当他关闭窗口前能够在主页面上能获的打开页面当前的地址!

不知道javascript能够实现吗?
...全文
29 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
hjhing 2002-03-17
  • 打赏
  • 举报
回复
**I think these sourcecodes are so simple that no need more explain

**parent.htm
<head>
<script>

window.open("son01.htm")
</script>
</head>
<body>
<input type=text name="textn" >
</body>
**son01.htm
<head>
<script>
function maincall()
{
window.opener.textn.value=document.location.href
}

function changehref()
{
document.location.href="son02.htm"
}
</script>
</head>
<body onbeforeunload="maincall()">
<input type=button name="buttonn" value="href to son02.htm" onclick="changehref()">
</body>
**son02.htm
<head>
<script>
function maincall()
{
window.opener.textn.value=document.location.href
}

function changehref()
{
document.location.href="son01.htm"
}
</script>
</head>
<body onbeforeunload="maincall()">
<input type=button name="buttonn" value="href to son01.htm" onclick="changehref()">
</body>
ahui_net 2002-03-14
  • 打赏
  • 举报
回复
我是要在主页面判断,你那body是加在什么地方?
孟子E章 2002-03-14
  • 打赏
  • 举报
回复
<body onbeforeunload="alert(window.location.href)">

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧