title: How to use ajax to load new page into div
body: <p>My site consists of two pages. I'm trying to load Page 2 into a div on page one, then display page 2 onclick.  I'm trying to use the following code which isn't working.  I'm a newbie so my apologies if this is just dumb question.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;
  &lt;/script&gt;
  &lt;script&gt;
  $(document).ready(function(){
    $("button").click(function(){
      $.ajax({url:"myPage2.html",success:function(result){
        $("#div1").html(result);
      }});
    });
  });
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div id="div1"&gt;&lt;h2&gt;Let jQuery AJAX Change This Text&lt;/h2&gt;&lt;/div&gt;
  &lt;button&gt;Get External Content&lt;/button&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>