2011-05-20 40 views
0
$('#quest').click(function() { 
        $('#replaceit').load('class/cars.php?q=true',function(){$('#replaceit').collapsible('refresh');}); 

之後不施加「不能呼籲可摺疊之前初始化方法;試圖調用方法‘刷新’」jquery的:移動式.load()

所生成

HTML代碼似乎是工作細例如:

<div data-collapsed="true" data-role="collapsible"> 
<h1>Which warranty policy of the following is the best for you?</h1> 
<p><input type="checkbox" value="2yearsunlimittedkilometers" name="question[Warranty][]">2 years unlimitted kilometers 
<input type="checkbox" value="3yearsor60000kilometers" name="question[Warranty][]">3 years or 60000 kilometers 
</p></div> 

,但尚未它不是定型成可摺疊:(..任何線索

+0

@Momen你的問題讓我明白的地方在使用.listview( '刷新')我自己的代碼:'$('#data').load('http://mydomain.com/app2/includes/php/data.php',function(){$('#data')。listview('refresh ');'。謝謝! – 2012-02-21 16:45:53

回答

1

看起來就像你在函數調用中缺少一些右括號

你有這樣的:

$('#quest').click(function() { 
    $('#replaceit').load('class/cars.php?q=true',function() { 
     $('#replaceit').collapsible('refresh'); 
}); 

看起來應該是這樣的:

$('#quest').click(function() { 
    $('#replaceit').load('class/cars.php?q=true',function() { 
     $('#replaceit').collapsible('refresh'); 
    }) 
}); 

而且我心中已經從來沒有見過這樣的:

collapsible('refresh') 

你能提供的文檔/例子它?

也許嘗試:

$('#replaceit').collapsible().page(); 

替代語法爲您的HTML標記:活生生的例子:http://jsfiddle.net/Rj6AW/4/

<div data-role="page" id="home"> 
    <div data-role="content"> 
     <div data-collapsed="true" data-role="collapsible"> 
      <legend>Which warranty policy of the following is the best for you?</legend> 
      <fieldset data-role="controlgroup" data-role="fieldcontain">     
       <input type="checkbox" value="2yearsunlimittedkilometers" name="question[Warranty][]" id="2yearsunlimittedkilometers" /> 
       <label for="2yearsunlimittedkilometers">2 years unlimitted kilometers</label> 
       <input type="checkbox" value="3yearsor60000kilometers" name="question[Warranty][]" id="3yearsor60000kilometers" /> 
       <label for="3yearsor60000kilometers">3 years or 60000 kilometers</label> 
      </fieldset> 
     </div> 
    </div> 
</div> 
+0

$('#replaceit')。collapsible()。page();是我的問題:)非常感謝你^。^ – Zalaboza 2011-05-20 22:50:00