title: Very simple jquery post() (trying to send html to another page)
body: <p>I am struggling with the <code>post()</code> method. </p>
  
  <p>I've been reading several posts on here and the jquery forums, and just trying to get a simple piece of code working is proving difficult. My ultimate goal is to pass a div #exportData and all it's children to test.php. </p>
  
  <p>I started with:</p>
  
  <pre><code>$.post("ajax/test.php", $("body").html());
  </code></pre>
  
  <p>To my mind this should return the entire contents of the current page to test.php (unless test.php requires a holding div or element to receive the content). Currently it only returns the blank page.</p>
  
  <p>I then tried looking at the parameters for <code>post()</code> if I need to manipulate these:</p>
  
  <pre><code>$.ajax({
          type: 'POST',
          url: ajax/test.php,
          data: data,
          success: success,
          dataType: dataType
      });
  </code></pre>
  
  <p>Also declared a variable:</p>
  
  <pre><code>var data = { 
          html: #exportData
      };
  </code></pre>
  
  <p>That bit failed of course. I don't know how to define the data in the parameters, or if this is the right place to do it. </p>
  
  <p>Although I would have thought if:</p>
  
  <pre><code> $.post("ajax/test.php", $("body").html());
  </code></pre>
  
  <p>would have worked then presumably I can substitute "body" for any class, id or selector I like. </p>
  
  <p>Also does the submit button need certain parameters to tie it to the post function. At the moment it is purely:</p>
  
  <pre><code>&lt;input type="submit" id="submit" value="send" name="submit"&gt;
  </code></pre>
  
  <p>Sorry this is such a basic question. </p>