Save bytes
This commit is contained in:
parent
7eb85a75f8
commit
8d4b241156
|
@ -139,14 +139,8 @@ var ajaxTimeout;
|
|||
* @return XMLHttpRequest or false in case of an error
|
||||
*/
|
||||
function ajax(url) {
|
||||
var xmlhttp;
|
||||
if (window.XMLHttpRequest) {
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
} else if (window.ActiveXObject) {
|
||||
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
var xmlhttp = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : false));
|
||||
if (xmlhttp) {
|
||||
var currentState = ++ajaxState;
|
||||
clearTimeout(ajaxTimeout);
|
||||
ajaxTimeout = setTimeout(function () {
|
||||
|
@ -164,6 +158,7 @@ function ajax(url) {
|
|||
}
|
||||
};
|
||||
xmlhttp.send('');
|
||||
}
|
||||
return xmlhttp;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue