Jade/Node.js: Display loading message while loading posts from Tumblr

I have a Node.js application that loads posts from Tumblr and then displays them.
When the server gets a request from a client, the server then gets the last 5 posts from the Tumblr and passes them to Jade, which renders the template and converts to HTML before passing the whole thing to the client.

Of course, since loading the posts from Tumblr is asynchronous, the first time the client accesses the page, the posts object will be empty (because the request is rendered and sent before the posts can be received from Tumblr). However, after refreshing the page, the posts object is no longer empty, and the page fills with posts from Tumblr.

Right now, like any decent webpage, mine displays "Loading posts from Tumblr" if the posts object passed is null or empty. Because of the asynchronous nature of the post-fetching method, though, it does require a page refresh to see the posts. I want to avoid refreshing the page using JavaScript though, so how could I load the page dynamically, showing "Loading posts from Tumblr" while retrieving from Tumblr and then updating the page without refreshing?

Below are a few relevant code snippets.

The post-fetcher method:

function getPosts() {
    var self = this;
    var posts = {};
    blog.text({limit: 5}, function(error, response) {
        if (error) {
           throw new Error(error);
        }

        self.posts = response.posts;
    });

    if (main.debug) console.log(posts);
    return this.posts;
}

The request handler:

app.get('/', function(req, res) {
    res.render('index', {
        title: "My Site",
        posts: getPosts()
    });
});

The Jade block extension that displays the posts:

if posts == null
  .postContainer#nullPosts
    h1 Still loading!
    p
      | You caught us at a bad time: we're still loading posts from
      | Tumblr. Try refreshing the page in a few seconds.
    p#emote Sorry! (>u///u<)
else
  for post in posts
    .postContainer
      h1
        a(title='View on Tumblr', target='_blank', href='#{post.post_url}')
          if post.title == ""
            = post.timestamp
          else
            = post.title
      p !{post.body}
      p.tags
        for tag in post.tags
          = "#" + tag + " "

Socket.IO might do the trick for you. Open a socket connection and send the images via them. Socket polls the server after a certain time. Till you are not having any data from socket, you can handle that from client side by displaying the message.

The second alternative is make an ajax get call from the client side and till it is not done show the loading image and in success block remove the loading image.