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?
Re-edited so that you guys can see the whole method
function socialbookmarksTableData(data)
{
var toAppend = '';
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>';
}
});
$.each(data.results, function(i, id){
if(i%2 == 1)
toAppend += '<tr class="first">';
else
toAppend += '<tr class="second">';
if(data.results[i].status == "PENDING" || data.results[i].status == "POSTED")
toAppend += '<td><span class="approved">' + data.results[i].status + '</span></td>';
else
toAppend += '<td>' + data.results[i].status + '</td>';
toAppend += '<td><select name="sb2" id="sb2">'+
'<option value="'+ data.results[i].bookmark +'">' + data.results[i].bookmark +'</option>' +
bookmarkingSites + '</select></td>';
toAppend += '<td>' + data.results[i].user + '</td>';
toAppend += '<td>' + data.results[i].link + '</td>';
toAppend += '<td>Some Article</td>';
toAppend += '<td>' + data.results[i].title + '</td>';
toAppend += '<td>' + data.results[i].description + '</td>';
toAppend += '<td>' + data.results[i].tags + '</td>';
toAppend += '<td>' + data.results[i].date + '</td>';
toAppend += '<td><div class="actions">';
toAppend += '<ul><li><input class="radio" name="input" type="checkbox" value="' + data.results[i].id + '" /></li>';
toAppend += '<li><a class="action1" href="#">1</a></li>';
toAppend += '<li><a class="action4" href="#">4</a></li></ul></div></td></tr>';
});
$("#searchTable tbody").append(toAppend);
}