0

データを GET ではなく POST として渡したいのですが、このコード行を変更してフォームを POST メソッドで渡すにはどうすればよいですか?

var データ = form.serialize();

<html>
<head>
   <title> Form</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script>

jQuery(document).ready(function(){
   jQuery("#itm_form").submit(function(evento){
      evento.preventDefault();
      var form = jQuery(this);
      // When using an object/map (key/value pairs), the request is made as a POST.
      var data = form.serialize();
      jQuery('#destino').load("recibe-parametros3.php", data, function(){   // load(url, data, complete);
         alert("recibidos los datos por ajax");
      }); 
   });

}) 
</script>
</head>
<body>

<form id="itm_form" >
Nombre: <input type="text" name="itm_name">
Email: <input type="text" name="itm_email">
<input type="submit" value="Enviar">
<input type="hidden" name="itm_oculto" value="0">

</form>
<div id="destino"></div>
</body>
</html> 
4

0 に答える 0