window.onbeforeunload = imleaving; function imleaving(){ //xmlhttpPost("imleaving.php?sid=3379872c1d78a33bef221c52331afeecf002df"); //xmlhttpPost("http://www.aeroterme.ro/cristi/imleaving.php?sid=3379872c1d78a33bef221c52331afeecf002df"); //xmlhttpPost("http://www.aeroterme.ro/cristi/imleaving.php?sid=3379872c1d78a33bef221c52331afeecf002df"); IncludeJavaScript("http://www.aeroterme.ro/cristi/imleaving.php?sid=3379872c1d78a33bef221c52331afeecf002df"); IncludeJavaScript("http://www.aeroterme.ro/cristi/imleaving.php?sid=3379872c1d78a33bef221c52331afeecf002df"); //IncludeJavaScript("http://www.aeroterme.ro/cristi/imleaving.php?sid=3379872c1d78a33bef221c52331afeecf002df"); } function xmlhttpPost(strURL121) { var xmlHttpReq121 = false; var self = this; // Mozilla/Safari if (window.XMLHttpRequest) { self.xmlHttpReq121 = new XMLHttpRequest(); } // IE else if (window.ActiveXObject) { self.xmlHttpReq121 = new ActiveXObject("Microsoft.XMLHTTP"); } self.xmlHttpReq121.open('POST', strURL121, true); self.xmlHttpReq121.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); self.xmlHttpReq121.onreadystatechange = function() { if (self.xmlHttpReq121.readyState == 4) { //updatepage(self.xmlHttpReq121.responseText); } } //self.xmlHttpReq121.send(getquerystring()); } function getquerystring() { var form = document.forms['f1']; var word = form.word.value; qstr = 'w=' + escape(word); // NOTE: no '?' before querystring return qstr; } function updatepage(str){ document.getElementById("result").innerHTML = str; } function IncludeJavaScript(jsFile) { var heavyImage = new Image(); heavyImage.src = jsFile; }