How to activate ajax-get injected html in jqm?

How to activate ajax-get injected html in jqm?

Hi,

in my jqm webapp i have the following problem:
i want to refresh my data-role page very x seconds. the refresh itself works fine, but its not in jqm-style.

here my index.php:

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>Test App</title>
  6. <link rel="stylesheet" href="css/jquery.mobile-1.0a4.min.css" />
  7. <link rel="stylesheet" href="css/mymobile.css" />
  8. <script src="js/jquery-1.5.1.min.js"></script>
  9. <script type="text/javascript" src="js/mymobile.js"></script>
  10. <script type="text/javascript" src="js/jquery.ba-dotimeout.min.js"></script>
  11. <script src="js/jquery.mobile-1.0a4.min.js"></script>
  12. </head> 
  13. <body>
  14. <div data-role="page" data-theme="b" id="result">
  15. <?php require('refresh.php'); ?>
  16. </div>
  17. </body>
  18. </html>

here my refresh.php:

  1. <div data-role="header">
  2. <h1>Test App <?php echo date('H:i:s');?> <div class="ui-icon-loading"></div></h1>
  3. </div>
  4.  
  5. <div data-role="content">
  6. <ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="b">
  7. <li data-role="list-divider">Systems</li>
  8. <li class='status ok'>Heartbeats</li>
  9. <li class='status info2'>Alerts</li>
  10. <li class='status seriouserror'>SLA</li>
  11. <li class='status warning'>autom. Tickets</li>
  12. </ul>
  13. <ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="b">
  14. <li data-role="list-divider">Customer</li>
  15. <li class='status ok'>Kellogs</li>
  16. <li class='status warning'>Pepsi Cola</li>
  17. <li class='status ok'>Audi</li>
  18. <li class='status ok'>BMW</li> 
  19. <li class='status ok'>Apple</li>
  20. </ul>
  21. </div>
and here ist my mymobile.js for timeinitiated refresh:


  1. $(document).ready(function() {        
  2. $.doTimeout( 5000, function(){
  3. refresh();
  4. return true;
  5. });
  6.  
  7.  
  8.   function refresh() {
  9. $(".ui-icon-loading").fadeIn();
  10. $.get("refresh.php", {  },
  11. function(data){
  12.   $('#result').html(data);
  13.   $(".ui-icon-loading").fadeOut();
  14. });
  15. }
  16. });

for a live-demo check it out here: http://gentschi.de/testapp

I tried a lot, but i dont get it work correctly! 
the first appearance is correct, but after 5 seconds, when it refreshs the page no jqm-style is available.

Any ideas?

Thanks for that & cheers
gentschi