title: Can't bind jQuery selectors to anything but document - Rails 3.2
body: <p>Super weird problem here. I'm having trouble getting jQuery to bind any selectors except document, inside a .js file.</p>
  
  <p>example code:</p>
  
  <pre><code>$(document).click(function () {
   $("#nav_primary").empty();
  });
  </code></pre>
  
  <p>when I click anywhere, the nav_primary div empties, as expected, however, when I use this code:</p>
  
  <pre><code>$("div").click(function () {
   $("#nav_primary").empty();
  });
  </code></pre>
  
  <p>nothing happens when I click. UNLESS I enter it into my console. When I paste the above code into my firebug console, it loads as expected, and clicking anywhere empties out the div as expected.</p>
  
  <p>I know javascript and jquery are both running, as I have this in my js and it logs as expected:</p>
  
  <pre><code>console.log("js is running");
  if (jQuery) {console.log('jQuery is loaded!');}
  </code></pre>
  
  <p>I've heard there are conflicts with prototype, but I don't think i'm running it. here's my head:</p>
  
  <pre><code>&lt;head&gt;
    &lt;link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt;
    &lt;script src="/assets/jquery.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="/assets/jquery_ujs.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="/assets/portfolio.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="/assets/application.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
    &lt;link href="/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" /&gt;
    &lt;meta content="authenticity_token" name="csrf-param" /&gt;
    &lt;meta content="(token here)" name="csrf-token" /&gt;
    &lt;!--[if !IE 7]&gt;
      &lt;style type="text/css"&gt; #main {display:table;height:100%} &lt;/style&gt;
    &lt;![endif]--&gt;
    &lt;!--[if lt IE 9]&gt;
      &lt;script src='//html5shiv.googlecode.com/svn/trunk/html5.js'&gt;&lt;/script&gt;
    &lt;![endif]--&gt;
  &lt;/head&gt;
  </code></pre>