All pastes #814764 Raw Edit

Mine

public text v1 · immutable
·published 2007-12-13 15:21 UTC
rendered paste body
function assegna() {
	var XHR = null;
	browserUtente=navigator.userAgent.toUpperCase();
	
	if (typeof(XMLHttpRequest)==="function" || typeof(XMLHttpRequest)==="object")
		{
			XHR = new XMLHttpRequest();
		}
	else if (window.ActiveXObject && browserUtente.indexOf("MSIE 4") < 0)
		{
			if (browserUtente.indexOf("MSIE 5") < 0)
				{
					XHR = new ActiveXObject("Msxml2.XMLHTTP");
				}
			else 
				{
					XHR = new ActiveXObject("Microsoft.XMLHTTP");
				}
		}
	return XHR;
}


function gebi(idelemento){
	var elemento;
	if (document.getElementById){
		elemento=document.getElementById(idelemento);
	} else {
		elemento=document.all(idelemento);
	}
	return elemento;
}



var xhr = assegna();

function keepalive ()
		{

			if (xhr){
				xhr.open("GET", "keepalive.php?idSession=$idSession&" + Math.random(), true);
				xhr.setRequestHeader("connection", "close");
				xhr.send(null);
				xhr.onreadystatechange=function(){
					if (xhr.readyState != 4) return;						if (xhr.status == 200){

						} 					}
				}
			}
		}