xonecas.io
142
St

startsInvasion / files

startsInvasion / libs / node_modules / reqwest / README.md

1.2 KB
1It's AJAX
2---------
3All over again.
4
5The happs
6---------
7
8    $ git clone git://github.com/ded/reqwest.git
9    $ cd reqwest
10    $ npm install --dev
11    $ npm run-script boosh
12
13API
14---------
15
16``` js
17reqwest('path/to/html', function (resp) {
18  qwery('#content').html(resp);
19});
20```
21
22``` js
23reqwest({
24  url: 'path/to/json',
25  type: 'json',
26  method: 'post',
27  success: function (resp) {
28    qwery('#content').html(resp.content);
29  },
30  error: function (err) { }
31});
32```
33
34``` js
35reqwest({
36  url: 'path/to/data.jsonp?callback=?',
37  type: 'jsonp',
38  success: function (resp) {
39    qwery('#content').html(resp.content);
40  }
41});
42```
43
44``` js
45reqwest({
46  url: 'path/to/data.jsonp?foo=bar',
47  type: 'jsonp',
48  jsonpCallback: 'foo',
49  success: function (resp) {
50    qwery('#content').html(resp.content);
51  }
52});
53```
54
55The Tests
56---------
57    npm test
58    open http://localhost:1234
59
60Browser support
61---------------
62  * IE6+
63  * Chrome 1+
64  * Safari 3+
65  * Firefox 1+
66  * Opera
67
68Ender Support
69-------------
70Reqwest can be used as an [Ender](http://ender.no.de) module. Add it to your existing build as such:
71
72    $ ender add reqwest
73
74Use it as such:
75
76``` js
77$.ajax({ ... });
78$(form).serialize();
79```
80
81**Happy Ajaxing!**