0
我正在使用jQuery Mobile,並且需要刪除位於標籤上方的undefined
字。 data
是json,它返回sucessfuly幾乎正確地構建html。除了undefined
我有這樣的動態代碼jquery未定義的數據在ajax中返回
HTML
<div class="ui-field-contain" id="selectNovoCorAnimal">
</div>
的Javascript
function corAnimal(data){
var html
html += '<label for="corNovoAnimal" class="select">Cor</label>'
html += '<select name="corNovoAnimal" id="corNovoAnimal" data-native-menu="false">'
$.each(data, function (i, x) {
html+='<option value='+ x.id + '>'+ x.descricao +'</option>';
});
html += '</select>'
$('#selectNovoCorAnimal').html(html).enhanceWithin();
}
哪個構建這樣的:
undefined <<< need remove this
Cor
[Amarelo] << select
爲什麼給我不確定?