showing results for - "jquery ajax promise"
Anna
18 Feb 2019
1function doTheThing() {
2  return new Promise((resolve, reject) => {
3    $.ajax({
4      url: window.location.href,
5      type: 'POST',
6      data: {
7        key: 'value',
8      },
9      success: function (data) {
10        resolve(data)
11      },
12      error: function (error) {
13        reject(error)
14      },
15    })
16  })
17}
Gael
08 Jan 2018
1doTheThing()
2  .then((data) => {
3    console.log(data)
4    doSomethingElse()
5  })
6  .catch((error) => {
7    console.log(error)
8  })
Wolf
27 Jan 2021
1function ajax(options) {
2  return new Promise(function (resolve, reject) {
3    $.ajax(options).done(resolve).fail(reject);
4  });
5}
Lyna
13 Apr 2018
1function doTheThing() {
2  $.ajax({
3    url: window.location.href,
4    type: 'POST',
5    data: {
6      key: 'value',
7    },
8    success: function (data) {
9      console.log(data)
10    },
11    error: function (error) {
12      console.log(error)
13    },
14  })
15}
Martina
15 Jun 2019
1doTheThing()
2doSomethingElse()
Felix
30 Jan 2020
1  $.ajax({
2    url: "/someurl",
3    method: "GET",
4    data: { 
5      a: "a"
6  })
7  .done(function(data) {
8    console.log('success callback 1', data) 
9  })
10  .done(function(data) {
11    console.log('success callback 2', data) 
12  })
13  .fail(function(xhr) {
14    console.log('error callback 1', xhr);
15  })
16  .fail(function(xhr) {
17    console.log('error callback 2', xhr);
18  });
19
queries leading to this page
javascript promise with ajax calljquery promois doneajax call with promisesjquery ajax promise alwaysjavascript promis ajaxjquery 24 ajax return promiseare js promises ajaxajax promisreturn ajax promise jqueryjquery callback orderreturn a promise to ajax callpromise jwaquery ajaxjquery ajax finallyjquery promises ajaxawait javascript promise ajaxjquery ajax get promiseajax with promisesjquery when ajax promisejquery get promisejquery promisesjavascript jquery promise thenjquery set htem thenajax promise apihow to return a promise from a function jquerypromise ajax calldoes ajax support promiseuse ajax call inside promise functionpromise in jqurypromises in ajax jqueryjquery post promisejquery ajax call with promisejquery return ajax promisewhat does an ajax promise request to jqueryjquery ajax promise getjquery ajax promise examplescalling jquery ajax promiseshow 28 29 jquery promisejavascript promise with ajaxwhat is a promise ajax thensample promise ajax call jsreturn jquery ajax promisejquery ajax with promisejquery rest promise examplejavascript does ajax return a promisejs promis with ajaxjquery ajax promise returnjquery post promisesjavascript promise ajax requestajax call in promisejquery promise supportajax done failajax promise syntaxjavascript promise jquery ajaxajax call promise jswhat is a promise ajax 24 when jquery ajaxreturn ajax data in promisecreate ajax requests jquery promiseajax promise javascriptgetting whole html page returned ina promise how to render jquerypromise 2b jquery ajaxjquery return promisejavascript ajax with promisehjquery promisejquery html promise donejs promise ajaxajax response promisasync jquerypromise then method in ajaxjavascript ajax promise example with function callajax vs promiseshould you do ajax inside a promisehow to use promise jqueryjquery ajax last function to executeajax get promisejquery click promisepromises javascript ajaxpromise callback jqueryjquery promise ajax getajax with promiseajax promise handlingpromise in ajaxvanilla javascript ajax promisepromise 28 29 jqueryajax on success result dlist of promise functions ajaxajax is a promiseajax jquery via postjquery asyncajax with promijquery promise ajax thenajax promise then before sendajax using promisesjquery promise donereturn promise ajax jquerypromise 3d ajax jsjquery ajax promise examplehow to make promise in ajaxjavascript ajax promisejquery 3 4 1 have promises 3fjquery promise examplejquery 24 ajax with thenajax done promisereturn new promise ajax callpromise ajaxapi accept or reject jquery databasedoes ajax uses promisehow to get data from ajax promiseis ajax promiseajax promise exampleajax promise jqueryhow to use promise in ajax callhow to make ajax return promisejquery ajax then examplepromise then jqueryajax get with promisejs promise with ajaxjquery ajax thenjquery post with promisesjquery get promisesjquery await or promisejquery post return promisepromise ajax requestjquery ajax promiseshow to use promise in jqueryhow to call api when before api geting response in jquerypromise in jquery ajaxcall ajax on promise thenajax promise like interface jqeury subhow to use jquery promise thenpromise jquery ajax examplepromises jquerypromises and js ajaxajax response success true data falsepromises ajax 24 ajax promiseuse promises with jquery ajaxpromise ajax jquerypromise example with ajax request jqueryajax promises with jquery 24 ajax jquery promisehow to done 28 29 fail 28 29 ajaxjavascript ajax promise es6is ajax a promisejquery ajax send request to another server urlajax send expect jsonpromise jquery 2 xjquery return a promisejquery ajax promisepromise in jquerypromise with ajax jqueryajax call as promisejavascript promise with jqueryreturn promise example ajaxpromise based jquery ajaxpromise from jquery ajaxhow to use promise in jquery ajax callpromise with jquery ajaxjs return promise with ajaxjquery promise thenhow to use ajax in promisepromise javascript ajaxwhat jquery api used for promise like ajaxjavascript jquery when with ajax promise ajax async callresolve in jquerywrap ajax call in promisejquery ajax return promisejquery promise ajax example 5cjavascript promise pure ajax calljquery promise nextajax jquery promiseajax call promiseajax then jqueryjavascript and jquery promisejquery return promise from ajaxjquery promise postawait jquery ajaxpromise with ajaxhow to use promise with 24 ajax jqueryajax promises jqueryjquery ajax wit promisesajax request when thenpromise jqueryjquery promise ajax examplepromise jquery ajaxusing promise and ajax call pure es6 promise jquery ajaxajax call using promisejavascript promise ajaxajax with promise thenjquery ajax turn to promiseajax promis andjquery run ajax when ajax is donepromises ajax javascriptpromise in ajax javascriptajax promisejquery promisejquery asynchjavascript ajax promise exampleasync call jqueryjavascript jquery when with promisesjquery ajax no rundisable asynchronous function jqueryjquery ajax promise awaitajax and ajax promise 27use promise in ajax requesthow to use promises with ajaxajax promisesjavascript ajax call promisepromise in ajax responsejs ajax call promisedone promis ajax jqueryjquery promise ajaxjquery post as prmiseajax promises returnpromises in ajaxjquery promises ajax donejs promises and ajaxajax call done promise result jquerycallbacks and promises in jqueryajax return promise jquerywhen done ajaxjquery ajax call promisehow to use promise to return data from ajax calljquery reobject promiseis ajax a promisepromise jq what is considered a collectionjavascript promise ajax callpromise with jquery ajax returna ajax promesereact promise going into rejected without making ajax request calljquery ajax promise