0

I have two 's in one html page.

In the first "page", I have a link to the second page.

I need to fire an event after the user clicks the link and after the DOM has been instantiated by jquery mobile.

I thought that event was "pagecreate", but this event only fires the first time. I need to capture an event that fires every time that link is clicked by the user.

Please help (or let me know if I need to provide more info).

Thanks

kane
  • 5,465
  • 6
  • 44
  • 72
  • 1
    cant you do an (on click function) for that or use the new (pagecontainerbeforechange) event -- check here at this guide -- http://jqmtricks.wordpress.com/2014/07/13/pagecontainerbeforechange/ – Tasos Jan 05 '15 at 07:53
  • Choose between `pagecontainerbeforehide`, `hide`, `beforeshow`, `show`. – Omar Jan 05 '15 at 07:54
  • none of those work for me. $(document).on('show','#page2', function() {...} – kane Jan 05 '15 at 08:03
  • actually, pagecontainerbeforechange and pagecontainerbeforehide both fire if I just fire on the document and not the 2nd page ID itself. $(document).on('pagecontainereforehide', function() {...} works – kane Jan 05 '15 at 08:07
  • 1
    Pagecontainer events can't be delegated to a specific page. You need to check pages url or id and then run your code accordingly. – Omar Jan 05 '15 at 08:29
  • Related: http://stackoverflow.com/a/26835244/1771795 http://stackoverflow.com/a/20459433/1771795 – Omar Jan 05 '15 at 10:24

0 Answers0