2011-05-02 79 views

回答

1

僞代碼:

$('#aboutPage').live('pagecreate',function(event){ 
    alert('This page was just loaded/enhanced by jQuery Mobile!'); 

    // do ajax call to get list 
    $.ajax({ 
     url: 'yourRequestPage.php?parm='+yourSearchParm[option], 
     type: 'GET', 
     error : function(){ document.title='error'; }, 
     success: function (data) { 
      $('#selectOptionTag').html(data); 

      // Something like this: 
      $("div#selectOptionTag ul").listview(); 

      // Or this 
      $('ul').listview('refresh'); 
     } 
    }); 
}); 
+0

您放在那裏的兩種情況需要加載數據的不同方式。第一個 - 數據必須包含ul標籤,第二個 - ul標籤不能被覆蓋。 – naugtur 2011-05-04 11:57:47

+0

因此僞碼。不覆蓋ul標籤附加li標籤並通過ajax調用刷新。只是想給你一個關於如何去做這件事的想法 – 2011-05-04 13:08:31

+0

是的,我知道。我已經做過幾次了,人們說「不,它不起作用」,因爲他們沒有擺弄它,只是放入他們的代碼並等待它的工作:P「僞代碼」不適用於大多數人;) – naugtur 2011-05-05 07:23:54

相關問題