@fdaciuk/ajax
Advanced tools
Comparing version 2.0.0 to 2.0.1
/**! | ||
* ajax - v2.0.0 | ||
* ajax - v2.0.1 | ||
* Ajax module in Vanilla JS | ||
* https://github.com/fdaciuk/ajax | ||
* Mon Apr 25 2016 23:42:51 GMT-0300 (BRT) | ||
* Fri May 06 2016 10:30:34 GMT-0300 (BRT) | ||
* MIT (c) Fernando Daciuk | ||
*/ | ||
!function(e,t){"use strict";"function"==typeof define&&define.amd?define("ajax",t):"object"==typeof exports?exports=module.exports=t():e.ajax=t()}(this,function(){"use strict";function e(e){var r=["get","post","put","delete"];return e=e||{},e.baseUrl=e.baseUrl||"",e.method&&e.url?n(e.method,e.baseUrl+e.url,t(e.data),e):r.reduce(function(r,u){return r[u]=function(r,o){return n(u,e.baseUrl+r,t(o),e)},r},{})}function t(e){return e||null}function n(e,t,n,u){var c=["then","catch","always"],s=c.reduce(function(e,t){return e[t]=function(n){return e[t]=n,e},e},{}),i=new XMLHttpRequest;return i.open(e,t,!0),r(i,u.headers),i.addEventListener("readystatechange",o(s,i),!1),i.send(a(n)),s}function r(e,t){t=t||{},u(t)||(t["Content-Type"]="application/x-www-form-urlencoded"),Object.keys(t).forEach(function(n){t[n]&&e.setRequestHeader(n,t[n])})}function u(e){return Object.keys(e).some(function(e){return"content-type"===e.toLowerCase()})}function o(e,t){return function n(){t.readyState===t.DONE&&(t.removeEventListener("readystatechange",n,!1),e.always.apply(e,c(t)),t.status>=200&&t.status<300?e.then.apply(e,c(t)):e["catch"].apply(e,c(t)))}}function c(e){var t;try{t=JSON.parse(e.responseText)}catch(n){t=e.responseText}return[t,e]}function a(e){return s(e)?i(e):e}function s(e){return"[object Object]"===Object.prototype.toString.call(e)}function i(e){return Object.keys(e).reduce(function(t,n){var r=t?t+"&":"";return r+f(n)+"="+f(e[n])},"")}function f(e){return encodeURIComponent(e)}return e}); |
{ | ||
"name": "@fdaciuk/ajax", | ||
"description": "Ajax module in Vanilla JS", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"main": "dist/ajax.min.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -57,3 +57,3 @@ # Ajax | ||
```html | ||
<script src="//cdn.rawgit.com/fdaciuk/ajax/v2.0.0/dist/ajax.min.js"></script> | ||
<script src="//cdn.rawgit.com/fdaciuk/ajax/v2.0.1/dist/ajax.min.js"></script> | ||
``` | ||
@@ -247,2 +247,8 @@ | ||
## Browser compatibility | ||
![Chrome][chrome-logo] | ![Firefox][firefox-logo] | ![IE][ie-logo] | ![Edge][edge-logo] | ![Opera][opera-logo] | ![Safari][safari-ios-logo] | ||
--- | --- | --- | --- | --- | --- | ||
Latest ✔ | Latest ✔ | 9+ ✔ | Latest ✔ | Latest ✔ | 3.2+ ✔ | ||
## License | ||
@@ -265,1 +271,7 @@ | ||
[deprecated]: deprecated.md | ||
[chrome-logo]: https://rawgit.com/alrra/browser-logos/master/chrome/chrome_48x48.png | ||
[firefox-logo]: https://rawgit.com/alrra/browser-logos/master/firefox/firefox_48x48.png | ||
[ie-logo]: https://rawgit.com/alrra/browser-logos/master/internet-explorer/internet-explorer_48x48.png | ||
[edge-logo]: https://rawgit.com/alrra/browser-logos/master/edge/edge_48x48.png | ||
[opera-logo]: https://rawgit.com/alrra/browser-logos/master/opera/opera_48x48.png | ||
[safari-ios-logo]: https://rawgit.com/alrra/browser-logos/master/safari-ios/safari-ios_48x48.png |
11589
275