Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

现在有个这样的需求:A页面通过一个a标签打开了B页面,现在想通过操作B页面让A页面实现跳转。请问有没有好的思路呢?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
2.7k views
Welcome To Ask or Share your Answers For Others

1 Answer

楼主的需求,基本上有两种做法。
1,按照楼上说的通过 window.opener 可以拿到打开当前页面的对象。https://wiki.developer.mozill...

2,通过数据操作,客户端请求来完成。进行类似消息接收的流程

a -> window.open(someTarget)
b -> 某个操作后向服务器发送一条推送,ID69B53 须要跳转到 http://www.baidu.com
a -> 接收到跳转协议,执行跳转(跳转参数是 b 传递的数据)

a 须要定时轮询接口 or websocket 或其它技术接收信息
b 要产生发送的信息

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...