I have a Jquery Mobile shell page, which I\'m loading a form into using Ajax. The form has some checkboxes, which I need to bind to.
Oddly, I can get it to work set
The way the .on()
method works changes according to how you use it. In your first example the .on()
method behaves similar to bind
and will only work on elements that already exist.
The second example behaves like .live()
or delegate()
in many ways. And will work for elements that are added later.
Read the docs for a detailed explanation http://api.jquery.com/on/