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");
            }
        });
};
make ajax request post jquery
$.ajax({
  method: "POST",
  url: "some.php",
  data: { name: "John", location: "Boston" }
})

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"); });
send ajax post request jquery
// Variable to hold request
var request;

// Bind to the submit event of our form
$("#foo").submit(function(event){

    // Prevent default posting of form - put here to work in case of errors
    event.preventDefault();

    // Abort any pending request
    if (request) {
        request.abort();
    }
    // setup some local variables
    var $form = $(this);

    // Let's select and cache all the fields
    var $inputs = $form.find("input, select, button, pre");

    // Serialize the data in the form
    var serializedData = $form.serialize();

    // Let's disable the inputs for the duration of the Ajax request.
    // Note: we disable elements AFTER the form data has been serialized.
    // Disabled form elements will not be serialized.
    $inputs.prop("disabled", true);

    // Fire off the request to /form.php
    request = $.ajax({
        url: "/form.php",
        type: "post",
        data: serializedData
    });

    // Callback handler that will be called on success
    request.done(function (response, textStatus, jqXHR){
        // Log a message to the console
        console.log("Hooray, it worked!");
    });

    // Callback handler that will be called on failure
    request.fail(function (jqXHR, textStatus, errorThrown){
        // Log the error to the console
        console.error(
            "The following error occurred: "+
            textStatus, errorThrown
        );
    });

    // Callback handler that will be called regardless
    // if the request failed or succeeded
    request.always(function () {
        // Reenable the inputs
        $inputs.prop("disabled", false);
    });

});

Javascript相关代码片段

React Modal using Dialog

how to create dynamic object in javascript

how to create global variable in postman

javascript interview questions tricky

how to create workflow request in postman

mysql json_extract array

parse response body in postman

query param generator js

jest function async API

React portal

i18next suppoeort react

puppeteer page evaluate

react router dom use navigate

react create array from another array

how to delete global variable in scripts postman

Where does closure variables stored in javascript

Where does local variables stored in javascript

nodejs là gì

addEventListener for multiple selector

js calculate opacity

nodejs create stripe payment from server easy

get child form value in parent viewchild

javascript capitalize every word in a sentence

how to use jquery in moodle

how to handle no internet error in react query

window in not defined in nextjs

cypress find element inside element

app tracking transparency react native permissions

C# Blazor list to json

puppeteer .cache folder not found

css in js

bootstrap next js

creat element js

angular can't bind to ngmodel

sandy liang

Toast Message always appears behind the modal

selenium and javascript

react native textinput should not autofill

form.getfieldvalue does not change antd

javascript zoom to bumber

javascript reduce exercises

array in js mdn

javascript built in priority queue

prevent parent click events from firing

what is intrinsic function in javascript

next js with pnpm

shopify emacs

dynamic scroll longitude antd table

tree vue js

eslint no-undef console

Count documents by field mongo

vertical column checkbox.group antd

dynamically adding class to anGULAR ELEMENT

random integer between 5 and 10 javascript

javascript refresh image src

url change tag javascript

change style using getelementsbyclassname

js uppercase türkçe

javascript sorting array using for loops

next js router not mounted

show image progress download in js

`NextRouter` was not mounted

Custom Dialog for GSheet

for each js on string

calculator in js

jsonserver

sweetalerts radio alert

how to add label to kubernetes node

react observer api

javascript metodlar

fixed height react quill editor

import js to postman

extract the domain name from a url javascript

react quill font colr doesn't change

Convert String to Date in JavaScript

signalr react

js regex srong password

password strength regex

import json into a var in typescript

Merge sort tree when two array is sorted