28
Apr
Learn how to detect if a user has got to a page using the back button?
Think if you has a page with data which load data using ajax and edited those data using ajax form. And go to another page using a link there. And click back button again & old data loaded and not loading last edited data. So you have to reload that page when click on back button.
Here is the solution for that.
<form name="ignore_me"> <input type="hidden" id="reload_this_page" name="reload_this_page" value="0" /> </form>
and here is the javascirpt for this.
var reload_bit = document.getElementById('reload_this_page'); if (reload_bit.value == '1') window.location.reload(); function mark_page_reload() { reload_bit.value = '1'; }
You have to put mark_page_reload() function when form updating.