title: Load part page with jQuery & AJAX
body: <p>I have a list of dynamic links on page A and a div where I wish to load content from another dynamically generated page B based on PHP variables. </p>
  
  <pre><code>&lt;a href="loader.php?id=1"&gt;Link 1&lt;/a&gt;
  &lt;a href="loader.php?id=2"&gt;Link 2&lt;/a&gt;
  &lt;a href="loader.php?id=3"&gt;Link 3&lt;/a&gt;
  </code></pre>
  
  <p>This script successfully loads the external content from the loader.php page using the jQuery script below into <code>#ajaxContent</code> div.</p>
  
  <pre><code>$(document).ready(function(){ 
      $("a").click(function(){
          $.ajax({
              url:$(this).attr("href"),
              success: function(response) {
                  $("#ajaxContent").html(response);
              }
          });   
          return false;
      });
  });
  </code></pre>
  
  <p>My question is how can I load content from a named div element on the loader.php page using a modification of the script above?
  The reason for this is to show the content called using Ajax in its correct context on the natural url eg: href="loader.php?id=2 which is proper non JavaScript enabled / SEO practice I believe.  </p>
  
  <p>Update:
  Nearly there Explosion Pills ! many thanks.</p>
  
  <p>Working code is.</p>
  
  <pre><code>$(".switchMe li a").click(function(){
  $.ajax({
  url:$(this).attr("href"),
  success: function(response) {
  //  $("#ajaxContent").html(response);
  $("#ajaxContent").html($(response).find("#imageInfo"));
  }
  });
  
  return false;
  });
  </code></pre>
  
  <p>Thanks Jimmy</p>