How to refresh page on specific day at specific time in specific time zone?

后端 未结 5 511
独厮守ぢ
独厮守ぢ 2020-12-17 04:47

I am developing a website that has two back to back web broadcasts. I have used PHP to display the time that the buttons should be enabled and disabled. Now I need to use Ja

5条回答
  •  盖世英雄少女心
    2020-12-17 05:43

    An alternative approach would be to use Pusher. This keeps an open connection to receiving events.

    Include the Pusher javascript:

    
    

    Bind to a pusher event of "refresh" with this code:

    var pusher = new Pusher('abc123'); // Get a key when you sign up and replace this
    var refreshChannel = pusher.subscribe('refreshing');
    refreshChannel.bind('refresh', function(thing) {
      location.reload(true);
    });
    

    Then at 8pm (or whenever you want) manually issue a pusher event on the Pusher control panel page, and all of the people currently viewing the page would be reloaded.

提交回复
热议问题