File: nanoajax.min.js

package info (click to toggle)
mapnik-reference 8.10.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,584 kB
  • sloc: python: 120; makefile: 17; sh: 3
file content (1 line) | stat: -rw-r--r-- 686 bytes parent folder | download | duplicates (3)
1
!function(e,t){function n(){if(t.XMLHttpRequest)return new t.XMLHttpRequest;try{return new t.ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(e){}throw new Error("no xmlhttp request able to be created")}function r(e,t,n){e[t]=e[t]||n}t.nanoajax=e,e.ajax=function(e,t){"string"==typeof e&&(e={url:e});var a=e.headers||{},o=e.body,u=e.method||(o?"POST":"GET"),i=e.withCredentials||!1,s=n();s.onreadystatechange=function(){4==s.readyState&&t(s.status,s.responseText,s)},o&&(r(a,"X-Requested-With","XMLHttpRequest"),r(a,"Content-Type","application/x-www-form-urlencoded")),s.open(u,e.url,!0),s.withCredentials=i;for(var c in a)s.setRequestHeader(c,a[c]);s.send(o)}}({},function(){return this}());