“Ajax Post Chamada” Respostas de código

Ajax Post Chamada

<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

Ajax Data Post Chamada em JavaScript

$.ajax({
   url: 'ajaxfile.php',
   type: 'post',
   data: {name:'yogesh',salary: 35000,email: '[email protected]'},
   success: function(response){

   }
});
Tame Teira

Faça o Ajax Police 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

Método de post Ajax

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 Pedido JavaScript

function myFunction()
{
    var elements = document.getElementsByClassName("formVal");
    var formData = new FormData(); 
    for(var i=0; i<elements.length; i++)
    {
        formData.append(elements[i].name, elements[i].value);
    }
    var xmlHttp = new XMLHttpRequest();
        xmlHttp.onreadystatechange = function()
        {
            if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
            {
                alert(xmlHttp.responseText);
            }
        }
        xmlHttp.open("post", "server.php"); 
        xmlHttp.send(formData); 
}
Indian Gooner

Respostas semelhantes a “Ajax Post Chamada”

Perguntas semelhantes a “Ajax Post Chamada”

Mais respostas relacionadas para “Ajax Post Chamada” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código