title: jQuery: How do I POST on CLICK?
body: <p>I'm trying to figure out how I can pass data from <code>page-list.php</code> to <code>page.php</code> using jQuery .post() and .click().</p>
  
  <p>Code in <code>&lt;head&gt;</code> of page-list.php:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function(){
      $('button.link').click(function () {
          $.post("page.php", {pageID: "1"} );
      }
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Code in <code>&lt;body&gt;</code> of page-list.php:</p>
  
  <pre><code>&lt;button class="btn link"&gt;LINK&lt;/button&gt;
  </code></pre>
  
  <p>When I click LINK, nothing happens. </p>
  
  <p>I'm also not sure how to call the posted data on page.php. Should I create a variable in PHP like this?</p>
  
  <pre><code>$pageID = ($_POST['pageID']);
  </code></pre>
  
  <p>And then call it in the body like this?</p>
  
  <pre><code>echo $pageID;
  </code></pre>