JSFiddle - React, Tailwind, and code Playground
JavaScript
function try1() {
return $.ajax({
type: 'POST',
url: '/echo/json',
data: {
"something": "somethingElse"
}
})
.then(d => {
console.log('something', d)
return "blah"
})
}
function try2(p) {
console.log('p', p)
return $.ajax({
type: 'POST',
url: '/echo/json',
data: {
"something": "even more"
}
})
.then(d => {
console.log('even more', d, "and p", p)
return "hey"
})
}
try1().then(try2);