In the first run we do this:
$(document)
.off('pagecreate','#MAT1000P00')
.on('pagecreate','#MAT1000P00', function() {
$(document)
.off('click','#MAT1000P00-listview li')
.on('click','#MAT1000P00-listview li', function() {....
for our first page. Now we want a function to do this on any page like this:
$(document)
.off('pagecreate')
.on('pagecreate',function (event,ui) {
var activePage = $.mobile.pageContainer.pagecontainer("getActivePage");
var activePageId = activePage[0].id;
$(document)
.off('click', '#' + activePageId + '-listview li')
.on('click', '#' + activePageId + '-listview li', function() {...
but the new code doesn't work... why?