WiserTogether/chiropractor — pull request #25 by richistron (2014-01-14 00:32:17+00:00)
Title: jquery cors

hey guys,

I have created a sample project for jquery.cors integration. [cors-test](https://github.com/richistron/cors-test/commits/master)

Unfortunately the code extracted from [wiser-commojs](https://github.com/WiserTogether/common-js) depends on files on the server side and client side either. So you need to copy a folder inside your project web root. Also some copy task should be added to move that code inside build folder.

Installing jquery.cors:

* copy jquery.cors folder to your application root folder
example:

```
cp -r src/components/chiropractor/jquery.cors src/
```

* add shim values

```
require.config({
paths:{
'chiropractor': '../components/chiropractor/chiropractor',
'console-shim': '../components/console-shim/console-shim',
'easyxdm': '../jquery.cors/easyxdm/easyxdm',
'jquery': '../components/jquery/jquery',
'jquery.cors': '../jquery.cors',
'json2': '../components/json2/json2'
},
shim: {
'json2': { exports: 'JSON' },
'jquery.cors/easyxdm/easyxdm': { exports: 'easyXDM' },
'easyxdm': {
deps: ['json2'],
exports: 'easyXDM'
},
'console-shim': { exports: 'console' }
}
});
```

* overwrite jQuery.ajax

```
require('jquery');
require('jquery.cors/jquery.cors');
```