Listview refresh after F5

Listview refresh after F5

Hello,

My script is ok but only when i refresh my page or when i put a alert into my code.
If i do not that, nothing is displayed.

My Javascript :
  1. $(document).ready(function(){
  2. var id_enseigne = $("#enseigne").val();
  3. var output = '';

  4. $.getJSON("portefeuille/magasin_load.php", {"enseigne": id_enseigne}, function(data){
  5.  
  6. $.each(data, function(key, val) {
  7. output+= '<li><a href=\"?p=3&id='+val.pdv_id+'\"><h3>' + val.pdv_ville + '</h3><p>'+val.Adresse+'</p></a></li>';
  8. }); // Fin du each
  9. $('#listview').append(output);
  10. $('#listview').listview('refresh');
  11. }); // Fin du json
  12. }); // Fin Document ready


My HTML :
  1. <div data-role="content">
  2.  
  3.         <ul id="listview" data-role="listview" data-filter="true">
  4. <?php //echo $list_pdv; ?>
  5. </ul>
  6.       </div>
    Thnak you for your help and sorry for my english !