Q:

JQuery/Javascript - Redirect to previous page when countdown reaches zero?

This is my first question and i'm fairly new to JS. Anyway, i found this countdown timer on JSFiddle ( http://jsfiddle.net/gPrwW/395/ )and i was wondering what edits need to be made to redirect to the previous page after the timer gets to zero? Thanks for the help!
$(document).ready(function(e) {
  var $worked = $("#worked");

  function update() {

    var myTime = $worked.html();
    var ss = myTime.split(":");
    var dt = new Date();
    dt.setHours(0);
    dt.setMinutes(ss[0]);
    dt.setSeconds(ss[1]);

    var dt2 = new Date(dt.valueOf() - 1000);
    var temp = dt2.toTimeString().split(" ");
    var ts = temp[0].split(":");

    $worked.html(ts[1] + ":" + ts[2]);
    setTimeout(update, 1000);
  }

  setTimeout(update, 1000);
});

A:

Try this out : 

<html>

<head>
  <script src="https://code.jquery.com/jquery-2.2.3.js" integrity="sha256-laXWtGydpwqJ8JA+X9x2miwmaiKhn8tVmOVEigRNtP4=" crossorigin="anonymous"></script>
  <script>
    $(document).ready(function(e) {
      var $worked = $("#worked");

      function update() {
        var myTime = $worked.html();
        if (myTime == "00:00") {
          window.history.back();
          return;
        }
        var ss = myTime.split(":");
        var dt = new Date();
        dt.setHours(0);
        dt.setMinutes(ss[0]);
        dt.setSeconds(ss[1]);

        var dt2 = new Date(dt.valueOf() - 1000);
        var temp = dt2.toTimeString().split(" ");
        var ts = temp[0].split(":");

        $worked.html(ts[1] + ":" + ts[2]);
        setTimeout(update, 1000);
      }

      setTimeout(update, 1000);
    });
  </script>
</head>

<body>
  <div id="worked">00:10</div>
</body>

</html>

