A webpage is fully loaded. There is an ajax request on this page that runs every 10 minutes. The callback of this request may take 2 seconds to 20 seconds. How can I make sure the request is complete with JavaScript? Note that I want to add this code to the page and I do not have access to the website code.
you need to use async
const data = await axios.method('url',{json})
.then(res => {//action})
.catch(err => {//action})