// var clickURL = "trackclick.php"; /* * @param url string the post url of the click tracker * @param args object with request args */ function invoke(url,args) { var pp = ''; var first = true; for(var a in args) { if(first) first = false; else pp = pp + '&'; pp = pp + a + '=' + encodeURI(args[a]); } url = url + '?' + pp; xmlHttp=GetXmlHttpObject() xmlHttp.onreadystatechange=showOutput; xmlHttp.open("GET",url,true); xmlHttp.setRequestHeader("Connection","close"); xmlHttp.send(null); /* var rq = createXMLHTTPObject(); rq.open("GET",url,true); rq.setRequestHeader("Connection","close"); rq.onreadystatechange = function() { } // we don't care about the result rq.send(null); */ } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } function trackClick(clickURL) { var args = new Object(); args.url = window.location; args.referer = window.document.referrer; args.size = 0; invoke(clickURL,args); } function showOutput() { /* if (xmlHttp.readyState==4) { var html=xmlHttp.responseText; alert(html); eval(html); }*/ } /* function createXMLHTTPObject() { var xmlobj; if(XMLHttpRequest) xmlobj = new XMLHttpRequest(); if((!xmlobj)) { if(ActiveXObject) { xmlobj = new ActiveXObject("Msxml2.XMLHTTP"); if(!xmlobj) xmlobj = new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlobj; } */