Using jQuery with google.load
<p>I am trying to understand how to use jQuery when it is loaded using Google CDN's google.load method.</p>

<p>Putting the init code in the setOnLoadCallback function works great but defining functions for event handlers in the markup doesn't seem to work. In the example below, the P button works as expected but the Div button does nothing.</p>

<p>Yes, in this example, I can put the div's onclick handler also in the setOnLoadCallback  function but does that mean that <strong>all</strong> jQuery code has to be there? </p>

<p>Help? Thanks</p>

<pre><code>&lt;p id="p"&gt;Content&lt;/p&gt;&lt;button type="button" id="btn1"&gt;P&lt;/button&gt;

&lt;div id="div"&gt;Div&lt;/div&gt;&lt;button type="button" id="btn2" onclick="btn2()"&gt;Div&lt;/button&gt;

&lt;script src="http://www.google.com/jsapi"&gt;&lt;/script&gt;

&lt;script&gt;

function btn2() {
 $("#div").toggle("slow");
}

google.load("jquery", "1.3.2");
google.setOnLoadCallback(function() {
$("#btn1").click(function () {
      $("p").toggle("slow");
});
});

&lt;/script&gt;
</code></pre>
