yui/yui3 — pull request #1304 by chrisrhut (2013-10-10 22:00:02+00:00)
Title: Fixes cross-domain REST model.load() in older browsers via a simple (optional) config update

Using ModelSync.REST with IE 8 and 9 was failing when loading with cross-domain GET requests (i.e. the URL of the source data is in a separate domain from the current browser window). Unlike with Y.io(), there is currently no way to pass an XDR config to the underlying AJAX request to fix these errors.

This change simply allows a user to include an XDR object in the "options" parameter of model.load, which is passed through to the underlying Y.io() call. So the documentation for that option applies (i.e. { use: 'native' }).

In IE 8 and 9, this enables the use of the XDomainRequest which supports XDR; additionally this eliminates the extra preflight OPTIONS request in modern CORS-compliant browsers since setting the XDR config object causes Y.io to remove the "X-Requested-With" header.