either
function f() {
return $.get("https://stackoverflow.com/");
};
async test() {
var x = await f()
console.log(x)
}
test()
or
f().then(function(res) {
console.log(res)
}
the async/await
is just another way to write the same logic.
More Related Contents:
- How can I upload files asynchronously with jQuery?
- How can I get jQuery to perform a synchronous, rather than asynchronous, Ajax request?
- How to select an element loaded through the jQuery load() function?
- jQuery ajax async: false causes a strange warning?
- jQuery AJAX cross domain
- Asynchronously load images with jQuery
- async/await always returns promise
- Is Safari on iOS 6 caching $.ajax results?
- How can I create an Asynchronous function in Javascript?
- Refresh/reload the content in Div using jquery/ajax
- Sequencing ajax requests
- What is the cleanest way to get the progress of JQuery ajax request?
- How do I send an AJAX request on a different port with jQuery?
- How to set selected value of jQuery Select2?
- How can I return a variable from a $.getJSON function
- How to implement a pseudo blocking async queue in JS/TS?
- Ajax HEAD request via Javascript/jQuery
- How to execute javascript inside a script tag returned by an ajax response
- Uploading File using Ajax in Asp.Net Core
- How to replace html element with ajax response?
- console.log(result) prints [object Object]. How do I get result.name? [duplicate]
- Why does jQuery.ajax() add a parameter to the url?
- how to use jQuery ajax calls with node.js
- how Postman send requests? ajax, same origin policy
- Await an iterative function without delimiter in JS
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
- Synchronous XMLHttpRequest on the main thread is deprecated
- ASYNC / AWAIT SyntaxError: await is only valid in async functions and the top level bodies of modules
- Is there any size limitation for ajax post?
- How to return an array from an AJAX call?