title: jquery mobile images dynamic loading
body: <p>I'm using phongap 1.5, jquery 1.7.1, jquery mobile 1.1.0</p>
  
  <p>in a multipage template I have this html:</p>
  
  <pre><code>&lt;ul data-role="listview" id="listviewPreferiti"&gt;&lt;/ul&gt;
  </code></pre>
  
  <p>when a button is tapped this js is executed
  (I prefere this approach to json and javascript expansion):</p>
  
  <pre><code>$("ul[id="listviewPreferiti"] li").remove();
  $("#listviewPreferiti").append(res).listview("refresh");
  </code></pre>
  
  <p>or this code that works the same as before:
      $("#listviewPreferiti").html(res).listview("refresh");</p>
  
  <p>res is a list of 'li' like this:</p>
  
  <pre><code>&lt;li&gt;&lt;a id="1" href="#"&gt;
      &lt;img src="http://www.pippo.com/images/02.jpg" class="ui-li-thumb"/&gt;
      &lt;p&gt;some text&lt;/p&gt;
  &lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a id="2" href="#"&gt;
      &lt;img src="http://www.pippo.com/images/03.jpg" class="ui-li-thumb"/&gt;
      &lt;p&gt;some other text&lt;/p&gt;
  &lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>the rendering usually work BUT: sometimes the images are not displayed until i tap the screen. I suppose that the reason is: the rendering process of jquery mobile finishes before the loading of the images (infact once the images are loaded, the problem does not occurr, reloading the same listview).</p>
  
  <p>How can i force the rendering of the images?
  (i tryed using jquery .live, but no luck)(I'm using an android 4 phone for tests)</p>
  
  <p>EDIT
  I've found this horrible patch to the problem
  after the append i call: refreshListView(listviewPreferiti,8);
  (i tryed $('img').trigger('refresh') dut doesn't work)</p>
  
  <pre><code>var refreshListView = function(listName, times){
      if (times &gt;0){
          setTimeout(function() {
              $("ul[id="+ listName +"] li img").each(function(index) {
                  this.style.borderBottom = "0px solid red";
              });
          },200); 
          refreshListView(listName, --times);
      }
  }
  </code></pre>