2012-09-18 208 views
0

我正在制作一个jQuery Mobile和PhoneGap应用程序。我正在动态加载选择菜单的选项。我希望第一个选项是我的选择菜单的默认“值”。追加后,我有我所有的选择,但没有选择。我尝试刷新和设置值属性,但它不起作用。下面是我的javascript:设置默认值od选择菜单

function customerList(data) 
{ 
    var html =''; 
    console.log('Start'); 
    $.each(data, function(key, value){ 
    html += '<option value="'+ data[key].id + '">' + data[key].label + '</option>'; 
    $('#customer').append($(html)); 
    html=''; 
    }); 
    $('#customer').selectmenu(); 
} 
+0

您在哪里设置您的'