我有以下的HTML代碼。它是一個可摺疊的listItems中的內彈出:用jquery附加到div
<div data-role="popup" id="wavelistPopup" class="ui-content">
<div id="wavlistContainer" data-role="collapsible-set" data-theme="c" data-content-theme="c" data-collapsed-icon="arrow-r" data-expanded-icon="arrow-d" style="margin:0; width:250px;">
<div data-role="collapsible" data-inset="false">
<h2>Wave1</h2>
<ul data-role="listview">
<li>Entfernung: </li>
<li>Von Autor:</li>
<li>Schwierigkeit:</li>
<li>Beschreibung:</li>
<li><a data-rel="dialog">Erfahrungsberichte</a></li>
<li><a data-rel="dialog">Wissenswertes</a></li>
<li><a data-rel="dialog">Ähnliche Waves</a></li>
</ul>
<button>Sync</button>
<button>Löschen</button>
</div><!-- /collapsible -->
</div><!-- /collapsible set -->
</div><!-- /popup -->
現在我想另一個可摺疊添加到wavlistcontainer用下面的代碼:。爲此,我首先做一個ajax調用,並在回調函數中工作。
function populateWaveList(){
console.log("populateWaveList");
requestWavesInArea(position.position.coords.latitude, position.position.coords.longitude,
position.position.coords.latitude+5, position.position.coords.longitude+5, 10,
function(waves){ //after AJAX call
console.log(waves);
for(var wavei in waves){ // for every element to add
var content = "";
var wave = waves[wavei];
console.log(wave);
var content =+ jQuery('somestring'; '<div data-role="collapsible" data-inset="false">'+
'<h2>'+wave.name+'</h2>'+
'<ul data-role="listView">'+
'<li>Entfernung von Autor: '+'...'+'</li>'+
'<li>Autor: '+wave.creatorname+'</li>'+
'<li>Beschreibung: '+wave.description+'</li>'+
'<li>Umfang: '+'...'+'</li>'+
'<li>Terrain: '+wave.terrainType+'</li>'+
'<li>Autor: '+wave.creatorname+'</li>'+
'<li>Schwierigkeit: '+wave.difficulty+'</li>'+
'<li>ID: '+wave.waveId+'</li>'+
'<li>Datum: '+wave.created+'</li>'+
'</ul>'+
'<button disabled="disabled">Sync</button>'+
'<button disabled="disabled">Löschen</button>'+
'</div>');
console.log(content); // returns 'false'
$('#wavelistContainer').append(content);
}
$('#wavelistPopup').popup('open', { x : 460, y : 180 });
});
}
當我打印的內容,我得到false
這greately混淆了我。任何人都可以幫助我嗎?
謝謝
如果您使用的答案改變的問題,他們得到無關緊要......這不是你應該如何使用SO ... –
你是對的,我再次執行錯誤:D – MJB