Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
var listen = function(last_modified, etag) {
console.log('Listening for new posts');
var xhrArgs = {
url: '/banshee/activity?id=unified-wall',
handleAs: 'json',
headers: {
"If-None-Match": etag,
"If-Modified-Since": last_modified
load: function(post, ioargs) {
var wall = $('.wall-posts');
addPostToWall(wall, post);
etag = ioargs.xhr.getResponseHeader("Etag");
last_modified = ioargs.xhr.getResponseHeader("Last-Modified");
listen(last_modified, etag);
error: function(error) {
console.log('Error while receiving post from server', post);
var deferred = dojo.xhrGet(xhrArgs);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment