Slide 16
Slide 16 text
Know your events
Problem
• I’ve used jQuery before but weird things are happening.
Solution
• Review the documentation for changes to the event handling.
• Changes were necessary to support touch, and to support the way that jQM
loads pages using AJAX.
• Use $(document).bind('pageinit'), not $(document).ready()
• New events include tap, taphold, swipe, swipeleft, and swiperight.
• Page navigation loads pages without executing the contents of .
– Account for situations where a user refreshes the page, or receives a link to
a page.
Resources
• jQuery Mobile Docs: Events