MassRelevance/massrel-js — pull request #8 by howardr (2013-01-25 22:42:45+00:00)
Title: CORS support

I have added really shitty support for CORS into massrel-js branch

It seems to work in all browsers I have on my comp and >= IE8. In browsers that do not support CORS and native JSON, the old JSONP request is made.

Can I get someone to look over my code

* Work cross browser Chrome, FF, Safar, IE 6+ (using cors when possible, falling back to jsonp)
* Double check that if there is any failure that `error` callback is called (network outages, server failures, 404's, etc.). This is important so that the `Poller` will know to try again.
* Make any improvements or rewrites that you see fit. I copied the cross browser CORS code from the internet without much modification
* Suggest any tests that are needed

Right now the entry point to all requests is the ugly `jsonp_factory` method. This method is still called with every request, but I check to see is CORS is supported there and call to that transport if available.