jQuery JSON help
- by kim
okay I'm new to jQuery and JSON but I have now done so I got some information from the database in JSON format and now I want to show the results in a nice way but I don't know how ;)
what I want is to show 5 newest threads on my page so will this script try to load all the time or do I need to do something else?
I want it to show the 5 newest threads and when there somes a new thread i should slide down and the 6 threads at the bottom should disappear
Here is my code
<script type="text/javascript">
$.getJSON('ajax/forumThreads', function(data) {
//$('<p>' + data[0].overskrift + '</p>').appendTo('#updateMe > .overskrift');
$('<div class="overskrift">' + data[0].overskrift + '</div>') {
$(this).hide().appendTo('updateMe').slideDown(1000);
}
//alert(data[0].overskrift);
});
</script>