<script src="Http://pv.sohu.com/cityjson?ie=utf-8" ></Script><ScriptType="Text/javascript" >Window.onload=function() {gettime ();JS gets the current time GetIP ();JS Get client IP geturl ();JS gets the client current URL getrefer ();JS gets the URL of the parent page of the client's current page getuser_agent ();JS Get client type GetCookie ()JS Get client Cookie Loadxmldoc (); }functionGetTime(){var nowdate =NewDate ();return nowdate.tolocalestring (); }functionGeturl(){return window.location.href; }functionGetIP(){Return returncitysn["CIP"]+', ' +returncitysn["CNAME"]; }functionGetrefer(){return document.referrer; }functionGetCookie(){return document.cookie; }functionGetuser_agent(){return navigator.useragent; }functionLoadxmldoc(){var xmlhttp;if (window. XMLHttpRequest) {xmlhttp=New XMLHttpRequest (); }else{xmlhttp=New ActiveXObject ("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){if (xmlhttp.readystate==4 && xmlhttp.status==200) {//alert (Xmlhttp.responsetext);}} //http://localhost/git_work/log.php//http://localhost:8088/log.php Xmlhttp.open ( Span class= "hljs-string" > "POST", "http://analysis.wml.com:8088/log.php", true); Xmlhttp.setrequestheader ( "Content-type", "application/ X-www-form-urlencoded "); Xmlhttp.send ( "time=" +gettime () + "&ip=" +getip () + "&url=" +geturl () + "&refer=" +getrefer () + "&user_agent=" +getuser_agent () + "&cookie=" + GetCookie ()); } </SCRIPT>
JS Get client time,cookie,url,ip,refer,user_agent information: