我是 jQuery mobile 的新手,所有 li 都完美地附加在 ul 中,但只是data-role=slider
不附加。
function getWebsiteDirectries()
{
var customer = "";
var li = "";
if(user_id.length != 0){
url = serviceURL +'customer-info.json?id='+user_id+'&action=get&request_type=web_directory';
$.getJSON(url, function(json) {
$('#web_list li').remove();
customer = json.items;
$.each(customer, function(key, value) {
$.each(value.customer.customer_toplist, function(key, value) {
li += '<li style="height:40px; line-height:40px;"><span class="f_right"><select data-role="slider" id="'+value.vName+'" name="'+value.vName+'" class="ui-slider-switch"><option value="0">OFF</option><option value="1">ON</option></select></span>'+value.vTitle+'</li>';
});
$('#web_list').append(li);
$('#web_list').listview('refresh');
});
});
}
}