var xmlHttp; function createXMLHttpRequest() { if (window.ActiveXObject) { //xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); try { xmlHttp = new ActiveXObject("MSXML2.ServerXMLHTTP.4.0"); } catch(e) { try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { alert("IE not surpport!"); } } } } else if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } } function sendText(param){ createXMLHttpRequest(); var url="stat2.php" ; xmlHttp.onreadystatechange = function () { }; xmlHttp.open("POST",url,false); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); //alert("aaaa" + param) ; xmlHttp.send(param) ; } var url = document.location.href ; var prev_url = document.referrer ; var param = "url=" + url + "&prevUrl=" + prev_url ; sendText(param) ;