title: setInterval not working in Chrome and Firefox when window loads
body: <p>My <code>setInterval</code> function does not appear to be working in Chrome and FF, but is working in IE, when I first go to a login page. </p>
  
  <p>I want to detect if a user has requested that their login data is saved as part of the login form. If it is saved, then the login button should be green. At the moment, it is not detecting that the form has remembered the credentials and the button is greyed out:</p>
  
  <pre><code>$(window).load(function () {
      setTimeout(function () {
          $(".busy-dialog").fadeOut(500);
      }, 1000);
      var evt = document.createEvent("Events");
      evt.initEvent("click", true, true);
      window.dispatchEvent(evt);
      setInterval(function () {checkLogin();}, 200);
  }); 
  </code></pre>
  
  <p>Where the <code>checkLogin</code> function is simply:</p>
  
  <pre><code>function checkLogin() {
      var email = $("#username").val();
      var password = $("#password").val();
      if (email != '' &amp;&amp; email != undefined &amp;&amp; password != '' &amp;&amp; password != undefined) {
          $("#loginform .button.primary").attr('disabled', false);
          $("#loginForm .button.primary").prop('disabled', false);
      } else {
          $("#loginForm .button.primary").attr('disabled', true);
          $("#loginForm .button.primary").prop('disabled', true);
      }
  }
  </code></pre>