开发者

Determine if page was refreshed

Would it be possible to determine if a webpage was accessed from the result of a refresh (pressing F5 or sim开发者_运维知识库ply clicking the refresh button) using JavaScript? I'm also using jQuery.


Try using the onbeforeunload() function or jQuery unload()


Not sure jQuery will help you here, but you could try

<html>
    <body onUnLoad='alert("Please do not leave!")'>
</html>

Should note that this will fire whenever the user tries to leave your page (Refresh or otherwise).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜