function annotations(){ if (token==""){ setTimeout(function(){annotations();},500); return; } var headers = {'x-annotator-auth-token':token}; $.ajax({ url: annotServer+'annotations?sortBy=uri', dataType: 'json', headers:headers, success: function(data) { //var items = []; var rows = data["rows"]; $('#annotations').html(""); for (var i=0;i'; ret +='
'+text+'
'; ret +='
'+author+'
'; ret +='
'+docUri+'
'; ret+=""; $('#annotations').append(ret); //items.push(ret); getDCdata(rows[i]['uri'],$('#an_'+i)); } //$('#annotations').html(items.join('')); } }); } $(document).ready(function(){ getToken(tokenGenerator,username); $.getJSON(annotServer+'tags', function(data) { var items = []; var rows = data["rows"]; // for (var i=0;i'+val+''); // // } items.push(''); $('#tagList').html(items.join('')); annotations(); }); });