“JQuery Post” Respostas de código

Exemplo JQuery Post JSON

<script type="text/javascript">
    function send() {
        var person = {
            name: $("#id-name").val(),
            address:$("#id-address").val(),
            phone:$("#id-phone").val()
        }

        $('#target').html('sending..');

        $.ajax({
            url: '/test/PersonSubmit',
            type: 'post',
            dataType: 'json',
            contentType: 'application/json',
            success: function (data) {
                $('#target').html(data.msg);
            },
            data: JSON.stringify(person)
        });
    }
</script>
Annoying Ape

JQuery Post

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

POST SOLD 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

Faça o Ajax Police Post JQuery

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

Better Bison

$ post em jQuery


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

Delightful Deer

Respostas semelhantes a “JQuery Post”

Perguntas semelhantes a “JQuery Post”

Mais respostas relacionadas para “JQuery Post” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código