title: How can I redirect to homepage window.location= 'URL'?
body: <p>I'm trying to redirect my users back to my homepage. I've written the following JavaScript code, but it isn't working. I'm not sure what I'm doing wrong.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var app = {
    paused: 0,
    init: function() {
      // add full screen object
      $('body').prepend('&lt;div id="cover"&gt;&lt;/div&gt;');
      //if mouse moves hide object
      $(document).mousemove(function(e) {
        $('#cover').hide();
      })
  
      // check every 5 seconds to see if object has been hidden by mouse move
      var int = setInterval(function() {
        if ($('#cover').is(":hidden")) {
          $('#cover').show();
          app.paused = 0;
        } else {
          app.paused += 5;
        }
        //if mouse hasn't moved, go back to main page
        if (app.paused &gt;= 15) {
          window.location = 'https://www.google.com/';
        }
        console.log(app.paused);
      }, 5000);
  
    }
  }
  
  $(document).ready(function() {
    app.init();
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>