为什么这行不通?
var data = {"one": [
{"slot1":true, "app":"facebook"},
{"slot2":true, "app2": "facebook"}
]};
$(data.one).each(function() {
if(this.slot1==true){
$('#dropable').find('.1_1').append('<img src="img/apps/' + this.app1 + '.png" alt="' + this.app1 + '">');
}
if(this.slot2==true){
$('#dropable').find('.1_2').append('<img src="img/apps/' + this.app2 + '.png" alt="' + this.app2 + '">');
}
});
我的#dropable:
<div id="dropable" class="drag"><div class="app 1_1"></div></div>
<div id="dropable" class="drag"><div class="app 1_2"></div></div>