title: ajax to retrieve data from another page after post
body: <p>I know this is very easy, but i only know the DOM equivalent of this code. the very long one. i've already searched trough some of the questions here in stack but i cant seem to find the solution.</p>
  
  <p>so basically i have this script:</p>
  
  <pre><code>function searchNow(str)
  {
      $.ajax({
      url: "search.php",
      type: "POST",
      async: false,
      data:  {"search": str},
      success: function(data){
              alert("test");
              $("#result").html(data);
          }
      });
  }
  
  &lt;table&gt;
  
  &lt;tr&gt;
      &lt;td&gt;Search: &lt;/td&gt;
      &lt;td&gt;&lt;input type = "text" name = "search" onBlur="searchNow(this.value)"&gt;      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p></p>
  
  <p>this will submit search to search.php to do a query search and retrieve the result and display it at id result.</p>
  
  <p>i can do this easily using the old DOM ajax but then i wanna try using this jquery version instead since it is cleaner and maybe faster.</p>
  
  <p>at my search.php
  i have this:</p>
  
  <pre><code>$search = $_POST['search'];
  return $search;
  </code></pre>
  
  <p>sadly i cant seem to return anything at all.</p>
  
  <p>some input would be greatly appreciated, im already starting to be familiar with jquery ajax but only on the same page, not on inter page manipulation.</p>
  
  <p>thank you,
  -magician</p>