Pressing the back button does not call <body> OnLoad

My cart shows (1) the animation for "Processing Order ..." after submitting (2), and the map is processed in a php script. However, an error occurred when the user reached the “Accepted Order” page and clicked the “Back” button. The animation "Processing order ..." is shown.

(1) The processing display is displayed as follows:

<div style="position:absolute;display:none;" id="animation">
    <img src="animation.gif"/>
</div>

(2) When the button is sent, javascript is used:

onClick="document.getElementById('animation').style.display='block';
         document.the_form.submit();"

So, the button is pressed, the animation is displayed, the submitted form and the map is processed, and the user is on a new page.

When the user clicks back, we should expect a page without animation. But onLoad does not start, and the last state of the animation is saved (displayed).

, , ?

+3
2

, , ( submit - , ), , / .

onunload HTML.

<body onunload="document.getElementById('animation').style.display='none';">
+3

, , ( , , ).

, , "" , , , -, : ", ".

+1

Source: https://habr.com/ru/post/1722311/


All Articles