Reload browser window after POST without prompting user to resend POST data

后端 未结 14 2054
盖世英雄少女心
盖世英雄少女心 2020-11-29 05:47

When a user visits my website there is a \"Login\" link on every page. Clicking this uses some JavaScript to show an overlay window where the user is prompted for their cred

14条回答
  •  执念已碎
    2020-11-29 06:20

    You can take advantage of the HTML prompt to unload mechanism, by specifying no unload handler:

    window.onbeforeunload = null;
    window.location.replace(URL);
    

    See the notes section of the WindowEventHandlers.onbeforeunload for more information.

提交回复
热议问题