funny behavior of jquery code
- by user253530
Funny thing is that if i delete the comment for alert(data[i].id) the code works. As it is in the example, the string is not concatenated thus i have no options in the select box. Hints? Help?
var bookmarkingSites = '';
$.getJSON("php/socialbookmark-get-bookmarking-sites.php",function(data){
for(var i = 0; i < data.length; i++){
//alert( data[i].id);
bookmarkingSites += '<option value = \"' + data[i].id + '\">' + data[i].title + '</option>';
}
});
<some more code>
-------> toAppend += '<td><select name="sb2" id="sb2">'+
'<option value="'+ data.results[i].bookmark +'">' + data.results[i].bookmark +'</option>' +
bookmarkingSites + '</select></td>';
<some more code>