title: JQuery Mobile .page() function causes infinite loop?
body: <p>I'm dynamically creating a listview with data from a AJAX response. It successfully creates the listview and populates it, but when i call JQM's .page() function on it, it seemingly goes into an infinite loop where the listview is appended forever.</p>
  
  <p>Is this a bug in JQM or am I doing something wrong?</p>
  
  <pre><code>pageScript(function($context){
      $context.bind("pagecreate", function(event, ui){
          createMenu(); //function that deletes existing ul#menu and dynamically creates new one. 
          $('ul#menu').page(); //here's where it causes a problem
          $('#menu a').bind('click', function(){
              $.mobile.changePage($(this).attr("href"), {pageContainer: $("#primary-content"), transition: "fade", changeHash: false, reloadPage: true});
              return false;
          });
      });
  });
  </code></pre>
  
  <p>pageScript is a function that allows me to run page-level scripts when they are loaded by JQM. It's defined in the base template or index.html:</p>
  
  <pre><code>function pageScript(func) {
              var $context = $("div:jqmData(role='page'):last");
              func($context);
          };
  </code></pre>