I have an action that i only want to trigger once.
The problem is that upon the user pressing [back navigation], it gets triggered again.
<script>
$(document).ready(function(event){
triggerActionOnlyOnce();
});
</script>
How do i tell the browser not to execute this comment if the user pressed “back?”
You can use the browser-mechanism to remember filled-in form-fields:
document and make it hidden using “display:none”
(doesn’t work with
<input type="hidden">)on ready first check the value, It should be empty:
if it does, give
it some value of your choice and call
triggerActionOnlyOnce()
if the value is not empty, the user came there using back/forward-> simply do nothing