calling jquery from ajax page
<p>I'm having trouble using jQuery with child page</p>

<p>parent.html loads child.html like so: ie user clicks </p>

<pre><code>&lt;a href="#" id="n-email"&gt;
</code></pre>

<p>JQuery</p>

<pre><code>$('a#n-email').click(function() {


    $.ajax({
   type: "GET",
   url: "/scripts/contact.js",
   dataType: "script"
 });

    $('#content').load("child.htm");         

});
</code></pre>

<p>contact.js</p>

<pre><code>$(function() {

    alert ("contact js hit");
}
</code></pre>

<p>This occasionally works. But i can't work out the logic why it works. I've also tried adding adding a ref to the Jquery on the handler also.  I feel like i'm missing a trick here. </p>

<p>Thanks to jake + lucus. I've got the following working. Needs a refactor, but works</p>

<p>$('#n-email').click(function() {
        var e = this;
        reset(e);</p>

<pre><code>    var mypage = $('#contentemail').load("email.php"); 

    $.ajax({
          type: "GET",
          url: "/scripts/contact.js",
          dataType: "script",
          success: function(mypage)
          {
              $(document).append(mypage);
          }
        });

    $('#contentemail').show();            

});
</code></pre>
