Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140734

React v16.5.2 - Raising a popup message with an unconditional screen refresh afterwards

$
0
0

I have a requirement to display a popup message (similiarly to the outcome of the "confirm" function of Alertify.js), and to unconditionally refresh the screen after the popup is being closed by the user, whether it is done through the 'X' or the 'OK' button.

Basically, the "confirm" function proposed by Alertify.js adheres to my need except its "Cancel" button (as it does nothing after the user clicks on it). If I could get rid of the cancel button somehow that would be great, but I'm not sure how to or if I'm even able to at all. What work-around would you suggest to that matter?

I tried this code,

alert("Successful Message");
location.reload();

This code causes the screen to refresh but doesn't show the alert. I guess the second line doesn't wait for the alert message to be closed and just immediately reloads the screen.

Thanks in advance!


Viewing all articles
Browse latest Browse all 140734

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>