国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

javascript - The page in the iframe frame controls the parent frame page to jump to a certain address
淡淡煙草味
淡淡煙草味 2017-06-23 09:11:55
0
3
1069

As shown in the picture, how to use js on page B to control page A to jump to a certain address?

淡淡煙草味
淡淡煙草味

reply all(3)
僅有的幸福

If it is from the same source, just window.parent.location.href can be used directly.
There is no solution if there are different sources and no control over the A page.

三叔

In the js of the B pagewindow.parent.window.location.href = '//www.baidu.com'

給我你的懷抱

a.html

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="utf-8">
</head>
<body>
    <iframe src="b.html"></iframe>
</body>
</html>

b.html

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="utf-8">
    <script type="text/javascript">
    function parentJump() {
        window.parent.location.;
    }
    </script>
</head>
<body>
    <button onclick="parentJump();">父頁(yè)面跳到百度</button>
</body>
</html>

Use window.parent to access the parent form from a page in an iframe.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template