/* * @author: yiruili * @date: 2018-07-18 10:00:57 * �ÿ�ͳ�� */ $(function () { !function () { var sitestatssign = readcookie("sitestatssignkey"); if (!sitestatssign) { writecookie( "sitestatssignkey", hex_md5(user_name + (new date()).valueof() + getrandomnum(10000, 99999)), 24 * 365 ); sitestatssign = readcookie("sitestatssignkey"); } // ip, pv, �����ÿ� sitestatsresponse("/public/useroperate.php", { username: user_name, rid: 1, mobile: $('script#sitestats').data("val") == 1 ? 1 : 0, type: 1, opt: 'ipv', sitestatssign: sitestatssign, t: date.parse(new date()) }); function sitestatsresponse (u, data, func) { $.ajax({ url: u, type: 'post', datatype: 'json', async: true, data: data, error: function (xmlhttprequest, textstatus, errorthrown) {}, success: function (res) { typeof func === "function" && func(data); } }); } function getrandomnum (min, max) { var range = max - min; var rand = math.random(); // return min + math.round(rand * range); return math.floor(math.random() * (max - min) + min) ; } }(); });