【发布时间】:2016-09-09 17:43:28
【问题描述】:
我有两个页面,具有不同的域。
我想从子页面知道开启页面的 url。但我无法通过 opener.location 进行操作。
例如。
Page1.html:
<html>
<head></head>
<body>
<script>
var handle = window.open("somedomain/Page2.html");
</script>
</body>
</html>
Page2.html
<html>
<head></head>
<body>
<script>
alert(opener.location) //this is not working.
</script>
</body>
</html>
【问题讨论】: