title: Why i not get post data when use javascript submit form by not loadpage?
body: <p>Why i not get post data when use javascript submit form by not loadpage ?</p>
  
  <p>First load page a.php and then press <code>OK button</code> why not echo <code>$_POST["id"]</code></p>
  
  <p>Here is javascript code</p>
  
  <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;form id="myForm" name="myForm" action="b.php" method="post"&gt;
      &lt;input type="text" name="id" value="1111111111111111111"&gt;
      &lt;button name="element" id="element" type="submit"&gt;OK&lt;/button&gt;
      &lt;div id="element_loading" style="display: none;"&gt;loading..................&lt;/div&gt;
      &lt;span id="element_result"&gt;&lt;/span&gt;
  &lt;/form&gt;
  
  &lt;script type="text/javascript"&gt;
  $('#myForm').submit(function(e){
      e.preventDefault();
      $.ajax({
          url: $("#myForm").attr("action"),
          data: $("#myForm:input").serializeArray(),
          type: 'post',
          dataType: 'html',
          success: function(data){
              $("#element_result").html(data);
          },
          beforeSend: function(){
              document.getElementById("element").disabled = true;
              document.getElementById("element_loading").style.display="inline";
              $("#element_result").hide()
          },
          complete: function(data){
              document.getElementById("element").disabled = false;
              document.getElementById("element_loading").style.display="none";
              $("#element_result").show()
          }
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>And this is php code</p>
  
  <pre><code>&lt;?PHP echo $_POST["id"]; ?&gt;
  </code></pre>