Save bytes

This commit is contained in:
Jakub Vrana 2010-10-17 07:19:01 +02:00
parent 7eb85a75f8
commit 8d4b241156

View file

@ -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;
}