Skip to content

Comment on Who Does Facebook Think You Are Searching For?

Comments

This is pretty funny in the ajax code:

    success: function(result) {
        alert('Please try again.');
    },
    error: function(data) {
        var text = data.responseText;
        // ... processes the data here...
    }
Why is success error and error success?

I think because the request is asking for content type JSON but the Facebook response comes back as javascript with a for (;;); at the beginning. The content types don't match so jQuery invokes the error callback.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.