Answer the question
In order to leave comments, you need to log in
How to pass a variable from a callback to an external code?
In the console, step is equal to undefind, but it is necessary that the data from the incoming response be saved. If you need to use async / await, then where exactly in this example?
let step;
$.ajax({
url: "https://kachay.com.ua/calculation_info.php",
dataType: "json",
type: "get",
success: function(res) {
step = res.data.sum_step
}
})
console.log(step)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question