Code is below. I want to show a pop up box kind of thing during the API call which will block further interaction with the page. This is HTML page with refreshStatus being a Javascript function which invoked when the button is clicked.
async function refreshStatus(mode)
{
//open a "wait...." animation here
var response = await fetch(
the_url,
{
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
},
body: JSON.stringify(dict)
}
);
//close the animation here
const jdata = await response.json();
ldata = jdata["results_list"];
}
2
Answers
You can add a fullscreen div, which overlays everything on your current page:
then you can show and hide the container once it’s needed:
You can add a fullscreen div, which overlays everything on your current page:
AND THE CODE TO FETCH DATA
replace "http://example.com/movies.json" with Your URL