title: Uncaught TypeError: history.push is not a function
body: <p>Here's my code:</p>
  
  <pre><code>var navStates = [true, false, false, false, false];
  var history = [];
  var historyPos = 0;
  var havingAWebsite = false;
  
  $(document).ready(function() {
      $("#infozion").trigger("focus");
      $("#content").hide().load("index_content.php").fadeIn("1000");
      $("html, body").animate({ scrollTop: 0 }, "fast");
      $(".navbar-brand").click(function() {
          $("#content").hide().load("index_content.php").fadeIn("300");
          navStates[0] = true; navStates[1] = false;
          navStates[2] = false; navStates[3] = false; navStates[4] = false;
          history.push(0);
          historyPos = history.length - 1;
          havingAWebsite = false;
      });
      $(".navbar-nav a:eq(0)").click(function() {
          $("#content").hide().load("services.php").fadeIn("300");
          navStates[0] = false; navStates[1] = true;
          navStates[2] = false; navStates[3] = false; navStates[4] = false;
          history.push(1);
          historyPos = history.length - 1;
          havingAWebsite = false;
      });
      $(".navbar-nav a:eq(1)").click(function() {
          $("#content").hide().load("tech.php").fadeIn("300");
          navStates[0] = false; navStates[1] = false;
          navStates[2] = true; navStates[3] = false; navStates[4] = false;
          history.push(2);
          historyPos = history.length - 1;
          havingAWebsite = false;
      });
      $(".navbar-nav a:eq(2)").click(function() {
          $("#content").hide().load("about.php").fadeIn("300");
          navStates[0] = false; navStates[1] = false;
          navStates[2] = false; navStates[3] = true; navStates[4] = false;
          history.push(3);
          historyPos = history.length - 1;
          havingAWebsite = false;
      });
      $(".navbar-nav a:eq(3)").click(function() {
          $("#content").hide().load("contact.php").fadeIn("300");
          navStates[0] = false; navStates[1] = false;
          navStates[2] = false; navStates[3] = false; navStates[4] = true;
          history.push(4);
          historyPos = history.length - 1;
          havingAWebsite = false;
      });
  });
  </code></pre>
  
  <p>The <code>history.push(0);</code> gives me Uncaught TypeError, which makes no sense, since history <strong>is</strong> an array and push <strong>is</strong> a function. </p>