27 nov 2009 09h57
Venda: Ssd Sata Wd Green 240gb - Para Notebook, Mini Pc - 2.5
Venda: Memoria Corsair 8gb (2 X 4gb) Ddr3 Notebook, Mini Pc
Venda: Injetor Poe Eap225 24v Passivo - Tl-poe2412g - Tp-link
Venda: Injetor Poe Ubiquiti 802.3at 48v 30w Gigabit U-poe-at
var xhr = new Array(); // ARRAY OF XML-HTTP REQUESTS
var xi = new Array(0); // ARRAY OF XML-HTTP REQUEST INDEXES
xi[0] = 1; // FIRST INDEX SET TO 1 MAKING IT AVAILABLE
//-----------------------------------------------------------------
// FUNÇÃO AJAX REQUEST
//-----------------------------------------------------------------
function xhrRequest(type) {
if (!type) { type = 'html'; }
// xhrsend IS THE xi POSITION THAT GETS PASSED BACK
// INITIALIZED TO THE LENGTH OF THE ARRAY(LAST POSITION + 1)
// IN CASE A FREE RESOURCE ISN'T FOUND IN THE LOOP
var xhrsend = xi.length;
// GO THROUGH AVAILABLE xi VALUES
for (var i=0; i<xi.length; i++) {
// IF IT'S 1 (AVAILABLE), ALLOCATE IT FOR USE AND BREAK
if (xi == 1) { xi = 0; xhrsend = i;
break;
}
}
// SET TO 0 SINCE IT'S NOW ALLOCATED FOR USE
xi[xhrsend] = 0;
// SET UP THE REQUEST
if (window.ActiveXObject) {
try {
xhr[xhrsend] = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xhr[xhrsend] = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
} else if (window.XMLHttpRequest) {
xhr[xhrsend] = new XMLHttpRequest();
if (xhr[xhrsend].overrideMimeType) {
xhr[xhrsend].overrideMimeType('text/' + type);
}
}
return (xhrsend);
}
var xhri = xhrRequest('html');
xhr[xhri].onreadystatechange = function(){
// ação a executar
};
© MNDTI - Tecnologia e Informação. Todos Direitos Reservados. Política de privacidade.