How can I refresh a tab from another using Javascript

后端 未结 3 515
迷失自我
迷失自我 2020-12-11 04:30

I\'m looking to achieve something like Wordpress does when you create a new post. It allows you to preview your post by opening a new tab. If, after that, you edit the post

相关标签:
3条回答
  • 2020-12-11 05:04

    If I remember correctly this is the way to do it:

    var win = window.open(url, "foobar");
    win.location.reload();
    
    0 讨论(0)
  • 2020-12-11 05:16

    You can do this by "storage" event. for more details follow

    Communication between tabs or windows

    https://developer.mozilla.org/en-US/docs/Web/Events/storage

    0 讨论(0)
  • 2020-12-11 05:22

    I think you're looking for the property window.opener. See http://www.w3schools.com/jsref/prop_win_opener.asp

    0 讨论(0)
提交回复
热议问题