Software development stuff.

2011-07-18

Using IDs in jQuery Mobile Pages

With JQuery Mobile different server pages are loaded on the same client DOM.
If you need to access an element by ID or class which conflicts with another element on another page with the same ID or class (in my case it was the same page with different parameters) you can use the ancestor on the JQuery selector as described by cplee70 in this forum thread:
Using IDs in jQuery Mobile Pages - jQuery Forum: "
$('div.ui-page-active .lat') instead of just: $('.lat')
EDIT:
Better yet, I started using: $('.lat', $.mobile.activePage)