I'd like to find out if a user presses F5 in a web browser before the page was fully loaded. I would like to use this as an indicator to find out if the page load time was too high for the user.
Is there a possibility?
Thanks much!
I'd like to find out if a user presses F5 in a web browser before the page was fully loaded. I would like to use this as an indicator to find out if the page load time was too high for the user.
Is there a possibility?
Thanks much!
with jQuery you can do something like this
var pageLoaded = false;
$(window).load(function(){
pageLoaded = true;
});
$(document).on('keyup', function(e){
if (!pageLoaded && e.keyCode == 116)
alert("f5 pressed before page fully loaded");
});
You can use the before unload event and save info somewhere:
$(window).bind('beforeunload',function(){
//save info
});
just notice, that this event will invoke when you close the browser as well.