(function () { var wait = "3"; var href = "javascript:history.back(-1);"; if (href.length > 0) { var interval = setInterval(function () { var time = --wait; if (time == 0) { location.href = href; clearInterval(interval); }; }, 1000); } })();