0

I have this simple code on a page

$(document).ready(function () {
alert(“works”);
    });

Then I go to the next page, I click in the browser back button and it doesn’t fire the $(document).ready, but if I return to previous page by a link it does. Tested on desktop browsers and no problem but doesn’t work on Safari or Chrome on IPad

Any idea? Thanks in advance

CREM
  • 1,929
  • 1
  • 25
  • 35
  • What do you mean by "doesn't work"? What does (or does not) happen on the iPad? – Pointy Apr 25 '16 at 21:05
  • @Pointy The event is not triggered when i return to previous page by back button – CREM Apr 25 '16 at 21:10
  • This is hard to believe to be true - that would mean the hundreds of sites my company has built have document ready functions that do NOT work on a "back" click.... – random_user_name Apr 25 '16 at 21:13
  • The issue is that exactly the same code works on desktop but no on Ipad. – CREM Apr 25 '16 at 21:17
  • 1
    Possible duplicate of [history.back(); doesn't trigger $(document).ready();](http://stackoverflow.com/questions/3628536/history-back-doesnt-trigger-document-ready) – random_user_name Apr 25 '16 at 21:17

0 Answers0