title: jquery event trigger not working
body: <p>I have two scripts.</p>
  
  <p>The first script holds a prototype class of a game. This class is with use strict and isn't surrounded by document ready. The trigger:</p>
  
  <pre><code>$("#trigger").trigger("noPossibilities");
  </code></pre>
  
  <p>In the second script, which also has use strict, I try to catch the trigger:</p>
  
  <pre><code>$(document).ready(function() {
      $("#trigger").on("noPossibilities", function() {
          console.log("noPossibilities trigger");
      });
  });
  </code></pre>
  
  <p>The problem is that I can't catch the trigger. This has probaly something to do with use strict/scope but I can't seem to find a way around this. </p>
  
  <p>Really hope someone can help me </p>
  
  <p><strong>UPDATE</strong>
  The first script has a prototype class.</p>
  
  <p>This class is getting instantiated in the second script. After the handler. Then it still doesn't work because the first script is loaded before the second script?</p>
  
  <p>Also when I execute this line from the console:</p>
  
  <pre><code>$("#trigger").trigger("noPossibilities");
  </code></pre>
  
  <p>It doesn't get triggered. Shouldn't it work this way?</p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>I found the problem. The first script adds the element with id trigger to the document when it is instantiated. I have a popup at the beginning of the game. Now the handler is getting attached on the click of that button. </p>
  
  <p>The document probaly didn't have the element on which the handler should have gotten attached to. Now it is being attached later on and now it's working.</p>