title: Ajax load page content after post form
body: <p>This is my html page:</p>
  
  <pre><code>&lt;body&gt;
      &lt;div id="containt"&gt;
           &lt;p&gt;already have containt.&lt;/p&gt;
      &lt;/div&gt;
      &lt;div id="other"&gt;
          &lt;form id="test"&gt;
               &lt;input id="sth" name="sth" value="123456"/&gt;
               &lt;div id="submit"&gt;&lt;/div&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  &lt;body&gt;
  </code></pre>
  
  <p>and my php script:"abc.php"</p>
  
  <pre><code>$happy['verymuch'] = $_POST['sth'];
  include('needtogetcontent.php');//and then use extract() to extract $verymuch in "needtogetcontent.php"
  </code></pre>
  
  <p>"needtogetcontent.php"</p>
  
  <pre><code>&lt;a href="&lt;?=$verymuch?&gt;"&gt;&lt;?=$verymuch?&gt;&lt;/a&gt;
  </code></pre>
  
  <p>Now I need to make html page like this:</p>
  
  <pre><code>&lt;body&gt;
      &lt;div id="containt"&gt;
           &lt;p&gt;already have containt.&lt;/p&gt;
      &lt;/div&gt;
      &lt;div id="other"&gt;
           &lt;a href="123456"&gt;123456&lt;/a&gt;
      &lt;/div&gt;
  &lt;body&gt;
  </code></pre>
  
  <p>Thanks for any help:D!</p>
  
  <p><strong>Update: I used</strong> </p>
  
  <pre><code>$('#submit').click(function() {
      $.ajax({
          url: 'abc.php',
          type: 'POST',
          data: $('#test').serialize(),
          success: function(data){
              //data will return anything echo/printed to the page.
              //based on your example, it's whatever $happy is.
              $('#other').text(data);
          }
      });
      return false;
  });
  </code></pre>