This has been driving me insane so hopefully someone can help me out :-D
I am trying to create a jquery mobile popup and within the popup I want to dynamically create a jQuery mobile listview. However I keep getting the following error message.
Uncaught TypeError: Cannot read property 'jQuery19104145257784985006' of undefined.
Here is my code
$('#create').on('click', function () {
//create a div for the popup
var $popUp = $("<div/>").popup({
dismissible: false,
theme: "a",
overlyaTheme: "a",
transition: "pop"
}).on("popupafterclose", function () {
//remove the popup when closing
$(this).remove();
});
//create a title for the popup
$("<ul data-role='listview'/>").trigger("create").appendTo($popUp);
$popUp.popup('open').trigger("create");
});
I have created a basic jsFiddle here http://jsfiddle.net/QA7Dm/
Any help is gratefully appreciated.