title: Using jQuery's ajax get request with parameters, returning page content
body: <p>I'm trying to use jQuery's get function to call my php script. The php script returns a variable containing the built template of the main content of my page minus my static header/footer.</p>
  
  <p>I would like to use the returned content to replace the "old" page content without the page reloading. Can anyone point me in the right direction as to where I'm going wrong here? My code is as follows...</p>
  
  <p>jQuery:</p>
  
  <pre><code>function getData(time, type) {
       $.ajax({
              type: "GET",
              url: "getData.php",
              data: "time=" + time + "&amp;type=" + type,
              success: function(data){
                 $('#pageContent').fadeOut("slow");
                 $('#pageContent').html(data);
                 $('#pageContent').fadeIn("slow");
       }
      });
      return false;
  }
  </code></pre>
  
  <p>getData.php(paraphrased):</p>
  
  <pre><code>    ....
  
      $time = empty($_GET['time']) ? '' : $_GET['time'];
      $type = empty($_GET['type']) ? '' : $_GET['type'];
      echo getData($time, $type);
  
      function getData($time, $type)
      ......
          .....
              $tmpl = new Template();
              $tmpl-&gt;time= $time;
              $tmpl-&gt;type = $type;
              $builtpage = $tmpl-&gt;build('index.tmpl');
              return $builtpage;
          .....
      ......
  </code></pre>
  
  <p>jQuery function call:</p>
  
  <pre><code>&lt;a href="#" onclick="getData('&lt;?php print $tmpl-&gt;time; ?&gt;', 'Orange')"&gt;Orange&lt;/a&gt;
  &lt;a href="#" onclick="getData('&lt;?php print $tmpl-&gt;time; ?&gt;', 'Apple')"&gt;Apple&lt;/a&gt;
  &lt;a href="#" onclick="getData('&lt;?php print $tmpl-&gt;time; ?&gt;', 'Banana')"&gt;Banana&lt;/a&gt;
  </code></pre>
  
  <p>When I click any link, the ajax seems to run fine, and the page does refuse to reload, but the content still remains unchanged... Anyone happen to know what's up?</p>