0
How do I tell the browser to reload the page after closing the alert box?
Hey there, I have been struggling to find a command that would refresh the page after you click "Ok" on an alert box, so my question is "is there any way to tell the browser to reload the page after you close the alert box?" To be more specific I don't have this problem when i open my script on a web browser as an .html file but it appears only when i run the code through the SoloLearn Code Playground using a PC (It works fine with the mobile app) This is what appears after you close the alert box: http://prntscr.com/ly00dk
3 odpowiedzi
+ 3
use confirm instead of alert
<script type="text/javascript">
var answer = confirm ("reload ?")
if (answer) location.reload();
</script>
edit:
if you're looking for alert only;
use the location.reload(); after the alert();
+ 2
use window.location.reload(true) after alert
0
The same thing happens... (http://prntscr.com/lxzxa0) Is it possible for this to be a bug into the Code Playground app? Or is my code wrong?