function initPage() { var backBtn = $j('#backBtn'); // Disable the back button if there is nothing to go back to backBtn.prop('disabled', !document.referrer.length); // Manage the BACK button document.getElementById("backBtn").addEventListener("click", function onBackClick(evt) { evt.preventDefault(); window.history.back(); }); // Manage the REFRESH Button document.getElementById("refreshBtn").addEventListener("click", function onRefreshClick(evt) { evt.preventDefault(); window.location.reload(true); }); } $j(document).ready(function() { initPage(); });