0

I have multiple pages in my jQuery mobile app and the "infamous" back button is being inserted dynamically; what I mean is that when the main page loads the back button does not show up on the second page in the DOM. As soon as I navigate to the second page jQuery mobile inserts the back button.

I am using the

 data-add-back-btn="true"

on the header div of the page to get the back button.

I want to run some of my own functions when the user clicks on the back button. My question is how can I target this dynamically generated content via JavaScript or jQuery?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user3262344
  • 125
  • 2
  • 4
  • 12
  • `$(document).on('click', 'there should be button selector', function() { alert("Some additonal code"); });` – Regent Sep 30 '14 at 05:45
  • listen to `navigate` event http://stackoverflow.com/a/18213393/1771795 – Omar Sep 30 '14 at 06:03

0 Answers0