Hello Reader's! if you need to detect whether the webpage is being refreshed by using Javascript you can do this like the example below:-
function CheckRefresh() {
if(document.cookie.indexOf('mycookie')==-1) {
// cookie doesn't exist, create it now
document.cookie = 'mycookie=1';
}
else {
// not first visit, so alert
alert('Page is just refreshed!');
}
}
and in your body tag:
<body onload="CheckRefresh()">
0 Comment(s)