title: Why does jQuery load twice in my GreaseMonkey Script
body: <p>for some reason my Firefox4+GreaseMonkey Script loads jQuery twice. I copy'n'pasted the following snippet, the "test" alert shows twice.</p>
  
  <p>Regards</p>
  
  <pre><code>var $;
  
  // Add jQuery
  (function(){
      if (typeof unsafeWindow.jQuery == 'undefined') {
          var GM_Head = document.getElementsByTagName('head')[0] || document.documentElement,
              GM_JQ = document.createElement('script');
  
          GM_JQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';
          GM_JQ.type = 'text/javascript';
          GM_JQ.async = true;
  
          GM_Head.insertBefore(GM_JQ, GM_Head.firstChild);
      }
      GM_wait();
  })();
  
  // Check if jQuery's loaded
  function GM_wait() {
      if (typeof unsafeWindow.jQuery == 'undefined') {
          window.setTimeout(GM_wait, 100);
      } else {
          $ = unsafeWindow.jQuery.noConflict(true);
          letsJQuery();
      }
  }
  
  // All your GM code must be inside this function
  function letsJQuery() {
      alert("test");
  }
  </code></pre>