// // basiclly this is Mikes version of Google Analytics // // // this is the JavaScript and AJAX code that // logs visits to websites like Google Analytics does // // // you have to call it either as: // // mikefakegagoogleanalytecs(''); // or // mikefakegagoogleanalytecs(userid); // function mikefakegagoogleanalytecs(userid) { // alert("high world"); var xmlhttp; // // this will be the parm field // we may pass it a userid if they // give us a userid // var userid_parm=""; // // this is the cgi program we should call // var cgi_program="http://mikjav.100webspace.net/google_analytics_cgi.php"; // // did they give us a userid??? // if (userid != "" ) { // // yes they gave us a userid // build a parm to pass to the CGI program // which includes the userid // userid_parm="?user="+userid; // alert("userid_parm="+userid_parm); // // add the userid on to the program we want to call // cgi_program=cgi_program+userid_parm; // alert("cgi_program="+cgi_program); } if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } // // this just sets the ADDRESS of the // anonymous function to execute // when the data is received // // in this case since the site we are linking to // is an external site ie: http://mikjav.100webspace.net // the site that is running this program will // not receive the output of the AJAX routine // which is per the rules of AJAX // xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { // document.getElementById("myDiv").innerHTML=xmlhttp.responseText; // document.getElementById("myDivXML").innerHTML=xmlhttp.responseXML; } } // // set up the script // // xmlhttp.open("GET","google_analytics_cgi.php",true); // xmlhttp.open("GET","http://mikjav.100webspace.net/google_analytics_cgi.php",true); xmlhttp.open("GET",cgi_program,true); // // run the script // // when the data is RECEIVED, the anonymous script // will be executed xmlhttp.send(); }