title: Can I call jQuery's click() to follow an <a> link if I haven't bound an event handler to it with bind or click already?
body: <p>I have a timer in my JavaScript which needs to emulate clicking a link to go to another page once the time elapses. To do this I'm using jQuery's <code>click()</code> function. I have used <code>$().trigger()</code> and <code>window.location</code> also, and I can make it work as intended with all three.</p>
  <p>I've observed some weird behavior with <code>click()</code> and I'm trying to understand what happens and why.</p>
  <p>I'm using Firefox for everything I describe in this question, but I am also interested in what other browsers will do with this.</p>
  <p>If I have not used <code>$('a').bind('click',fn)</code> or <code>$('a').click(fn)</code> to set an event handler, then calling <code>$('a').click()</code> seems to do nothing at all. It does not call the browser's default handler for this event, as the browser does not load the new page.</p>
  <p>However, if I set an event handler first, then it works as expected, even if the event handler does nothing.</p>
  <pre><code>$('a').click(function(){return true;}).click();
  </code></pre>
  <p>This loads the new page as if I had clicked the a myself.</p>
  <p>So my question is twofold: Is this weird behavior because I'm doing something wrong somewhere? and why does calling <code>click()</code> do nothing with the default behavior if I haven't created a handler of my own?</p>
  <hr/>
  <p>As Hoffman determined when he tried to duplicate my results, the outcome I described above doesn't actually happen. I'm not sure what caused the events I observed yesterday, but I'm certain today that it was not what I described in the question.</p>
  <p>So the answer is that you can't &quot;fake&quot; clicks in the browser and that all jQuery does is call your event handler. You can still use <code>window.location</code> to change page, and that works fine for me.</p>