“Ajax post” Ответ

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

Ajax Post Call

<script>window.onload = function(){
    let aData = {"profile": "developer", "to": "rashid.jorve@live.in"};
	console.log(FormData);
    $.ajax({
        type: "POST",
        url: "/api/saveProfile",
        data: JSON.stringify(aData),
        contentType: "application/json",  
            success: function(){
               alert("Request was successful");
            }
        });
};
Defeated Dormouse

JQUERY POST

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

Сделайте Ajax запрос Post jQuery

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

Better Bison

Ajax post

var myKeyVals = { A1984 : 1, A9873 : 5, A1674 : 2, A8724 : 1, A3574 : 3, A1165 : 5 }



var saveData = $.ajax({
      type: 'POST',
      url: "someaction.do?action=saveData",
      data: myKeyVals,
      dataType: "text",
      success: function(resultData) { alert("Save Complete") }
});
saveData.error(function() { alert("Something went wrong"); });
Proud Pintail

Ajax Post Method

function addtofav(e, id) {
            $.ajax({
                url: '@Url.Action("Action_Name", "Controller_Name")',
                type: 'POST',
                data: { Id: id }
            }).done(function () {
                swal('', 'Success_Message!', 'success');
            }).fail(function () {
                swal('', 'Failed_Message!', 'warning');
            })
        }
Said HR

Ответы похожие на “Ajax post”

Вопросы похожие на “Ajax post”

Больше похожих ответов на “Ajax post” по JavaScript

Смотреть популярные ответы по языку

Смотреть другие языки программирования