import JSON data in real-time via getJSON using AJAX

import JSON data in real-time via getJSON using AJAX

How can import new items in JSON and append them to document in real time using jQuery/AJAX? Basically, new JSON items from the feed be appended to document asynchronously in real-time. If you would like to see a similar concept in action, see What are people buying right now? on blippy or recent activities on cliqset .

Also, is it possible to only fetch/render certain number of returned JSON items at a time and fetch the next number of items via AJAX so not all of the JSON items data is loaded when document is ready but are loaded incrementally?

Any suggestions would be greatly appreciated. Thanks!


Edit: Im using $.getJSON instead of $.get but either way, can't setInterval() be used to re-run the funtion every time interval instead of setTimeout()? Also, when I use either setInterval() or setTimeout(), the function display the data from each run (so multiple/replicate set of data is shown and exact copies of those is added each time the function run). How can I make it only display the latest function run or simply only append new data items without having to replace the whole old data with the new ones from re-running the function? Thanks.