TypeError: parentPage[0] is undefined (line 5189 of jquery-mobile.1.1.1.js)
[Break On This Error]
parentId = parentUrl || parentPage[ 0 ][ $.expando ],
This is the code that does the ajax call and loads the DIV:
function handleGetReports(data) {
$('#recentReportsText').html(data).trigger('create');
$.mobile.changePage("#recentReportsPage", { changeHash:true});
}
function recentReports() {
$.post("getrecentreports.php",'',handleGetReports);
}
And this is the data that is returned by the ajax call:
<ul data-role="listview" data-split-icon="delete"><li data-role="list-divider">08/17 01:46pm<p class="ui-li-aside">Pending</p></li>
<li><a href="#">basic Company<br/>basic Username</a><a href="javascript:deleteReport('4');">Delete</a></li><li data-role="list-divider">08/16 06:50pm<p class="ui-li-aside">Complete</p></li>
<li><a href="javascript:popUp('reports/2012-08-16-3.pdf');">basic Info</a><a href="javascript:deleteReport('3');">Delete</a></li><li data-role="list-divider">08/16 06:44pm<p class="ui-li-aside">Complete</p></li>
<li><a href="javascript:popUp('reports/2012-08-16-2.pdf');">basic Number</a><a href="javascript:deleteReport('2');">Delete</a></li><li data-role="list-divider">07/16 06:38pm<p class="ui-li-aside">Pending</p></li>
<li><a href="#">basic Address</a><a href="javascript:deleteReport('1');">Delete</a></li></ul>
If I leave off the .trigger('create') call no error is generated but the data displayed is unenhanced (ie: no listview). If I cut and paste the ajax returned HTML and put it directly in the page in the CONTENT section to be displayed it displays correctly in split-list format as I intended. Is this a jquery mobile bug or am I doing something incorrectly? I am using jquery mobile 1.1.1 and jquery 1.7.2.