[javascript] Check if page gets reloaded or refreshed in JavaScript