title: dynamically creating jquery mobile list view within a jquery mobile popup
body: <p>This has been driving me insane so hopefully someone can help me out :-D</p>
  
  <p>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.</p>
  
  <p>Uncaught TypeError: Cannot read property 'jQuery19104145257784985006' of undefined.</p>
  
  <p>Here is my code</p>
  
  <pre><code>$('#create').on('click', function () {
      //create a div for the popup
      var $popUp = $("&lt;div/&gt;").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
      $("&lt;ul data-role='listview'/&gt;").trigger("create").appendTo($popUp);
  
      $popUp.popup('open').trigger("create");
  });
  </code></pre>
  
  <p>I have created a basic jsFiddle here <a href="http://jsfiddle.net/QA7Dm/" rel="nofollow">http://jsfiddle.net/QA7Dm/</a></p>
  
  <p>Any help is gratefully appreciated.</p>