“Solicitud post jQuery” Código de respuesta

JQuery Post

$.post( "test.php", { name: "John", time: "2pm" })
  .done(function( data ) {
    alert( "Data Loaded: " + data );
  });
Glamorous Goat

Solicitud post jQuery

 /* Get from elements values */
 var values = $(this).serialize();

 $.ajax({
        url: "test.php",
        type: "post",
        data: values ,
        success: function (response) {

           // You will get response from your PHP page (what you echo or print)
        },
        error: function(jqXHR, textStatus, errorThrown) {
           console.log(textStatus, errorThrown);
        }
    });
Breakable Bison

JQuery Post

$.post("demo.php",{id:1})
  .done(function(data) { console.log(data) })
  .fail(function() { console.error("Error") })
ProfCode

hacer una solicitud de AJAX Post jQuery

$.ajax({
  method: "POST",
  url: "some.php",
  data: { name: "John", location: "Boston" }
})

Better Bison

$ post en jQuery


$.ajax({
    method: "POST",
    url: "some.php",
    data: { name: "John", location: "Boston" }
}).done(function( msg ) {
    alert( "Data Saved: " + msg );
});

Delightful Deer

$ post en jQuery

$(function(){
    $('#myForm').on('submit', function(e){
      e.preventDefault();
      $.post('http://www.somewhere.com/path/to/post', 
         $('#myForm').serialize(), 
         function(data, status, xhr){
           // do something here with response;
         });
    });
});
Friendly Ferret

Respuestas similares a “Solicitud post jQuery”

Preguntas similares a “Solicitud post jQuery”

Más respuestas relacionadas con “Solicitud post jQuery” en PHP

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código