Is the unload event triggered when the page is reloaded by the location.reload() method?
window.addEventListener('unload', function(event) {
console.log('unload event was triggered');
});
location.reload(); // reload the current URL
Is the unload event triggered when the page is reloaded by the location.reload() method?
window.addEventListener('unload', function(event) {
console.log('unload event was triggered');
});
location.reload(); // reload the current URL