title: Greasemonkey Jquery Script to Click Links
body: <p>I'm trying to do my first greasemonkey script. I'm fairly new to jquery and javascript, so be easy on me.</p>
  
  <p>Here is what I have so far.</p>
  
  <pre><code>// ==UserScript==
  // @name           load all page comments
  // @require        http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js
  // @namespace      none
  // @include        http://www.reddit.com/*
  // ==/UserScript==
  
  setInterval( function () {
    window.alert("Hello World!");
    $("a:contains('load more comments')").click();
  }, 10000);
  </code></pre>
  
  <p>The goal here is to click on all of the "load more comments" page on a sample reddit page like this, and to loop doing it every ten seconds.</p>
  
  <p><a href="http://www.reddit.com/r/AskReddit/comments/i7hb5/why_assign_gender_to_public_bathrooms_if_there_is/" rel="nofollow">http://www.reddit.com/r/AskReddit/comments/i7hb5/why_assign_gender_to_public_bathrooms_if_there_is/</a></p>
  
  <p>Right now, only the hello world alert pops up, but the links aren't clicked.  So the interval function is working, but loading more comments isn't. Not sure where to go from here. Could the spaces in the 'load more comments' string be breaking it?</p>
  
  <p>Any help greatly appreciated. Thanks!</p>