title: Userscript to wait for page to load before executing code techniques?
body: <p>I'm writing a Greasemonkey user script, and want the specific code to execute when the page completely finishes loading since it returns a div count that I want to be displayed.</p>
  
  <p>The problem is, that this particular page sometimes takes a bit before everything loads.</p>
  
  <p>I've tried, document <code>$(function() { });</code> and <code>$(window).load(function(){ });</code> wrappers. However, none seem to work for me, though I might be applying them wrong.</p>
  
  <p>Best I can do is use a <code>setTimeout(function() { }, 600);</code> which works, although it's not always reliable.</p>
  
  <p>What is the best technique to use in Greasemonkey to ensure that the specific code will execute when the page finishes loading?</p>