title: Compatibility between GWT and JQuery
body: <p>I created a simple javascript that uses <code>jquery.tools.min.js</code> library.</p>
  
  <p>My javascript looks like this:</p>
  
  <pre><code>function testFunction() {
      $("img").click(function() {
          alert("Handler for .click() called.");
      });
  
      console.log("what's up?");
  }
  
  $(testFunction);
  </code></pre>
  
  <p>So when I try it on a simple HTML page, I get my alert message when I click on an Image.</p>
  
  <p>I added the exact same javascript in my GWT application.</p>
  
  <p>When the application loads I see the <code>console.log</code> message, but nothing ever happens when I click on any image on my app.</p>
  
  <p>Why is that so ? Is it because the <code>testFunction()</code> doesn't apply to the dynamically created images ? Or is it because the event was overriden by GWT ?</p>
  
  <p>Thank you.</p>
  
  <p><b>EDIT</b></p>
  
  <p>I tried recalling my function after I create my content:</p>
  
  <pre><code>public native final void recallFunction() /*-{
      $wnd.console.log('again1');
      $wnd.testFunction();
      $wnd.console.log('again2');
  }-*/;
  </code></pre>
  
  <p>I can see my log messages but no click event is fired.</p>
  
  <p><b>EDIT 2:</b></p>
  
  <p>When I run :</p>
  
  <pre><code>$("img").click(function() { 
      alert("Handler for .click()."); 
  });
  </code></pre>
  
  <p>or</p>
  
  <pre><code>testFunction();
  </code></pre>
  
  <p>directly in <strong>Firebug's</strong> console, the event is correctly attached to my images!!</p>
  
  <p>I tried also calling <code>testFunction()</code> in the window's onload event but with no better luck.</p>