ptest/public/js/script.js

1 строка
1.7 KiB
JavaScript
Исходник Обычный вид История

2017-01-22 23:47:24 +00:00
function bindReady(a){function b(){d||(d=!0,a())}function c(){if(!d&&document.body)try{document.documentElement.doScroll("left"),b()}catch(a){setTimeout(c,0)}}var d=!1;document.addEventListener?document.addEventListener("DOMContentLoaded",function(){b()},!1):document.attachEvent&&(document.documentElement.doScroll&&window==window.top&&c(),document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&b()})),window.addEventListener?window.addEventListener("load",b,!1):window.attachEvent&&window.attachEvent("onload",b)}function xH(){var a,b=!1;try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){try{a=new XMLHttpRequest}catch(b){a=!1}}}return a?(this.syn=function(b,c,d){return!!a&&(c=c.toUpperCase(),"GET"==c?(a.open(c,b+"?"+d,!1),a.send(null),200==a.status&&a.responseText):(a.open(c,b,!1),a.setRequestHeader("Method","POST "+b+" HTTP/1.1"),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.send(d),200==a.status&&a.responseText))},this.conn=function(c,d,e,f){if(!a)return!1;b=!1,d=d.toUpperCase();try{"GET"==d?(a.open(d,c+"?"+e,!0),e=""):(a.open(d,c,!0),a.setRequestHeader("Method","POST "+c+" HTTP/1.1"),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.send(e)),a.onreadystatechange=function(){4!=a.readyState||b||(b=!0,f(a))},a.send(e)}catch(a){return!1}return!0},this):null}Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;d<f;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});