多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
* * * * * ~~~ (function(namespace) { var ready = function(fn) { if(document.readyState != 'loading' && document.body) { fn() } else if(document.addEventListener) { document.addEventListener('DOMContentLoaded', fn) } else { document.attachEvent('onreadystatechange', function() { if(document.readyState != 'loading') { if(document.body) { fn() } } }) } }; //设置cookie function setCookie(name, value, cfg) { var Days = 356 * 5; var exp = new Date(); exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000); var param = ''; for(i in cfg) { param += "; " + i + "=" + cfg[i] } document.cookie = name + "=" + escape(value) + "; expires=" + exp.toGMTString() + param } //获取cookie function getCookie(name) { var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); if(arr = document.cookie.match(reg)) return unescape(arr[2]); else return null } //获取页面地址栏 function getUrlParam(name, url) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = url.substr(1).match(reg); if(r != null) return decodeURI(r[2]); return null } ready(function() { window.rootUrl2 = 'http://tongji.duoxiangweb.com'; if(typeof CODE == 'undefined') { window.CODE = getCookie('ucode'); if(CODE == null || CODE == undefined || CODE == '') { $.get(rootUrl2 + "/home/data/getCode", {}, function(res) { CODE = res.data; setCookie('ucode', res.data, { path: '/' }) }, 'JSON') } } var href = window.location.href; var host = 'http://' + window.location.host; var href_arr = href.split('?'); if(typeof PAGE == 'undefined') { window.PAGE = href_arr[0].replace(host, ''); PAGE = PAGE.split('/')[1] } if(typeof SOURCE == 'undefined') { window.SOURCE = ''; if(href_arr[1]) { SOURCE = href_arr[1] } if(typeof SOURCE == 'undefined') { SOURCE = '' } } setTimeout(function() { var data = { "code": CODE, "from": SOURCE, "land_page": PAGE, 'useragent': navigator.userAgent, 'referrer': document.referrer }; $.ajax({ url: rootUrl2 + "/home/access_log/add", type: 'POST', dataType: 'json', data: data, success: function(res) {}, error: function(res) {}, complete: function(XMLHttpRequest, status) {} }) }, 2500) }) })() ~~~