Frustrating User Experiences: Tough Captchas Revisiting why the Open Web matters; Gratuitous technology politics analogy
Aug 29

Frustrating User Experiences: Techmeme Meta Refresh

Tech with tags: , , Add comments

Refreshing Grapes

If you have a site or application where content updates regularly, it can be nice to update the content for the user. Techmeme falls under that category, and they have at the top of their page:

<META HTTP-EQUIV="Refresh" CONTENT="1800">

The problem is that every now and then I come back to the browser and I see:

TechMeme

The refresh seems to be happening when network connectivity isn’t there and thus you get hit and the page dies. This isn’t a huge pain, you can manually refresh, but for some reason it bugs me a little.

What can you do? An ugly, error prone technique would be to test a connection before doing a refresh:

function pingRefresh() {
  var location = window.location;
  var xhr = new XMLHttpRequest();
  xhr.open('HEAD', location);
  xhr.onreadystatechange = function() {
    if (this.readyState == 4 && (this.status == 0 || (this.status >= 200 && this.status < 300))) {
        window.location.reload();       
    }
  }
  xhr.send(null);
}
 
setTimeout(pingRefresh, 60000);

Or, it may make sense to be able to update part of the page (the main div or what have you) instead of asking the entire page to refresh. FriendFeed seems to do this and has:

var gFeedSpecs = {};
var gFeedAutoRefresh = [];
gFeedSpecs['feed1'] = {"start":0,"num":30,"type":2,"hash":"f003fa699d7e64b96f2b901922d13ed8"};
gFeedAutoRefresh.push('feed1');
$(function() { if (gFeedAutoRefresh) { autoRefresher.start(120000); maybeRestoreHtml() } });

Other Frustrating User Experiences

4 Responses to “Frustrating User Experiences: Techmeme Meta Refresh”

  1. henrah Says:

    Another (also ugly) approach to doing a simple ping:


    function ifConnected(callback) {
    var ping = new Image();
    ping.onload = callback;
    ping.src = '/blank.gif?' + new Date;
    };

    …assuming blank.gif exists and is an actual image.

  2. Gabe Says:

    Good point Dion! Thanks! I could use some grapes now.

  3. dion Says:

    Gabe,

    Thank you for providing a great service that sits in my Tab 4 :)

  4. bshenanigan Says:

    Won’t this mean that there are now two requests, rather than one? The HEAD request and the page request?

Leave a Reply

Spam is a pain, I am sorry to have to do this to you, but can you answer the question below?

Q: What is the number before 3? (just put in the digit)