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).
精彩评论