Here is the JSON I am trying to parse
{"sites":{"1":{"id":1,"company":"facebook","username":"abc@gmail.com","hint":"mascot"}}}
Here is the javascript parsing it. It was working then the structure of the JSON changed and I cannot for the life of me get it work. The result is 'undefinedundefined' which means that it does not understand what username and hint are. Any thoughts?
$.getJSON('http://localhost:3000/sites.json', 'limit=30', processWebsites);
function processWebsites(data) {
var infoHTML='';
$.each(data, function(website, websiteDetails) {
infoHTML+= websiteDetails.username
infoHTML+= websiteDetails.hint;
});
$('#info').html(infoHTML);
}
and finally the HTML
<body>
<div id = "info">
</div>
</body>