diff --git a/README.md b/README.md index 9c1e2ca..307689f 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ https://cdnjs.com/libraries/fdaciuk-ajax Or you may just add the following line to your HTML file: ```html - + ``` ## Usage diff --git a/dist/ajax.min.js b/dist/ajax.min.js index 32909ce..e4534a3 100644 --- a/dist/ajax.min.js +++ b/dist/ajax.min.js @@ -1,9 +1,9 @@ /**! - * ajax - v2.0.0-beta.1 + * ajax - v2.0.0 * Ajax module in Vanilla JS * https://github.com/fdaciuk/ajax - * Sun Apr 24 2016 12:45:29 GMT-0300 (BRT) + * Mon Apr 25 2016 23:42:51 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}); \ No newline at end of file