{"id":372,"date":"2011-05-29T06:50:00","date_gmt":"2011-05-29T16:50:00","guid":{"rendered":"http:\/\/mymonkeydo.com\/?p=372"},"modified":"2011-05-29T06:50:00","modified_gmt":"2011-05-29T16:50:00","slug":"onload-event-when-back-button-is-pressed","status":"publish","type":"post","link":"https:\/\/mymonkeydo.com\/onload-event-when-back-button-is-pressed\/","title":{"rendered":"Onload Event When Back button is Pressed"},"content":{"rendered":"
I have some ajax that pulls search results similar to how google images dynamically loads more images using javascript. \u00a0So if the user clicks to see ‘page 2’ or ‘more’, javascript runs and fetches more images without the user leaving the page. \u00a0If a user clicks on one of the results it will take them to another page. \u00a0If the user then presses the Back button, the page that the user was on is lost because it’s as if they are visiting the page for the first time. \u00a0 A variable can be saved on the page to remember what page the user was on, but the onload javascript functions do not run when the back button is press.<\/p>\n
<\/p>\n