Hacker News new | ask | show | jobs
by mononcqc 5974 days ago
I know that. What I don't get is why they chose that over JSONP, which solves the exact same problem by using <script> tags and a callback function.

Their solution seems to work well, anyway.

2 comments

The jsonp method causes older browsers to use a ton of memory if you leave the browser window open for a long period of time. You'll see that there's a whole bunch of script tags in the dom that aren't cleaned up. Given the way people use facebook & how many old browsers still exist, this is probably the reason facebook decided against it.
jsonp also causes unsightly "loading" indicators in most browsers.
Plus w/ jsonp can't get the response from POST requests and you don't get notification that your page didn't load. So your web-stack needs to be able to handle sending any errors via jsonp as well.

In any case, they don't solve the same problem. Jsonp solves the problem of talking to another domain (PostMessage does the same thing). Channels solve the problem of the browser limiting the number of concurrent HTTP requests you can have open to one domain.