“Ajax Post -Methode in jQuery” Code-Antworten

Ajax Post Call

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

Machen Sie Ajax Anfrage 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 -Methode

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

JQuery Ajax $ .post mit Daten

$.post('http://example.com/form.php', {category:'client', type:'premium'}, function(response){ 
      alert("success");
      $("#mypar").html(response.amount);
});
The Strangest Salamander

Ajax Post -Methode in jQuery

  $.post("demo_test_post.asp", // change demo_test_post.asp to your server route
  {
    name: "Donald Duck",
    city: "Duckburg"
  },
  function(data, status){
    alert("Data: " + data + "\nStatus: " + status);
  });
Beautiful Buzzard

Ähnliche Antworten wie “Ajax Post -Methode in jQuery”

Fragen ähnlich wie “Ajax Post -Methode in jQuery”

Weitere verwandte Antworten zu “Ajax Post -Methode in jQuery” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen