网站站长统计分析CNZZ

cnzz代码添加元素到页面
首先在cnzz上注册账号后,他会给你如下代码:

script type="text/javascript">var cnzz_protocol = (("https:" ==document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cspan id='cnzz_stat_icon_xxxxxxxxxx'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s19.cnzz.com/z_stat.php%3Fid%3D1252929438%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));

这段js代码的意思是:
根据当前页面所使用的传输协议来定义变量cnzz_protocol,如果是https协议,则cnzz_protocol="https://",否则为="http://"。
document.write()这个命令简单地打印指定的文本内容到页面上。
unescape() 函数可对通过 escape() 编码的字符串进行解码。 站长工具 ,我是在这里解码的,大家可以百度“unescape解码”,有很多在线解码工具的。
通过unescape()函数解码,我们可以得到:

"   id='cnzz_stat_icon_1252929438'>   src='" + cnzz_protocol + "s19.cnzz.com/z_stat.php?id=xxxxxxxxxx&show=pic1' type='text/javascript'>"

他创建了一个span元素,添加了一个script。这个script执行完毕后,页面变成下面
    
        
    

你可能感兴趣的:(pc)