Friday 27 March 2015

[SOLVED] how to know if page is refreshed in javascript

add this to the need to check is closed or refreshed !!


<script type="text/javascript">

window.onunload = function (e) {
// Firefox || IE
e = e || window.event;
var y = e.pageY || e.clientY;
if (y < 0) {
alert("close");
}
else {
alert("refresh");
}
}

</script>

No comments:

Post a Comment