After clicking the browser button, Opera browser does not start JS or server-side code (JSP) on the page

I do not have this problem in other popular browsers. On the JSP page (call Page1.jsp), I will click on the form that will go to another page. When I click the Opera Back button, it returns to the .jsp page, but the JavaScript or JSP code is not updated. For instance,

<!-- Inside header tag -->
<script language="JavaScript>
  alert("Does this work in Opera?");
</script>

A simple warning instruction does not work. The same goes for server code. However, other popular desktop browsers have no problems.

How can i fix this?

Thanks for any help.

Update

I had to say - and I apologize for this - this Page1.jsp file contains the frame / iframe in which the submit form lives. When the user submits the form, he loads a new page inside the frame / iframe. At this point, when the user presses the browser button back, I see that Page1.jsp is cached, but the frame / iframe is reloading. This happens in all popular browsers except Opera.

+3
source share
2 answers

@kennebec: Thank you very much. Due to your answer, I was able to do even more digging, and I found here a stackoverflow question and an Opera article here that addresses the issue:

history.navigationMode = "compatible"; // Opera only property
$(document).ready(function() {
  alert("test");
});

, navigationMode Opera. , , script . /, , , -, HTML5 onpageshow/onpagehide, , .

+1

, , , " ". , .

, " ", , , -

<script>
alert('loaded');

onunload=function(){ return true; }
</script>

, , - .

+3

All Articles