Cnzz code add element to page

Source: Internet
Author: User

First, after registering an account with CNZZ, he will give you the following code:

<script type= "Text/javascript" >var Cnzz_protocol = (("https:" = = Document.location.protocol)? "https://": "http: ");d Ocument.write (unescape ("%3cspan id= ' cnzz_stat_icon_xxxxxxxxxx '%3e%3c/span%3e%3cscript src= ' "+ cnzz_protocol + " ' type= ' text/javascript '%3E%3C/script%3E")); </ Script>
The meaning of this JS code is that

The variable cnzz_protocol is defined according to the transport protocol used by the current page, or cnzz_protocol= "https://" if it is the HTTPS protocol, otherwise = "http://".

document.write () This command simply prints the specified text content onto the page.

The unescape () function decodes a string encoded by escape (). Webmaster Tools, I am here to decode, we can Baidu "unescape decoding", there are many online decoding tools.

By decoding the unescape () function, we can get:

"<span id= ' cnzz_stat_icon_1252929438 ' ></span><script src= '" + Cnzz_protocol + " Stat.php?id=xxxxxxxxxx&show=pic1 ' type= ' text/javascript ' ></script> '
he creates a span element and adds a script.

When the script finishes executing, the page becomes the following

<span id= "cnzz_stat_icon_1252929438" >    <a href= " Xxxxxxxxxx "target=" _blank "title=" webmaster Statistics ">            </a></span><script src= " Show=pic1 "type=" Text/javascript "></script><script src=" &show=pic1&t=z "charset=" Utf-8 "type=" Text/javascript "></script>

on the principle of its flow statistics, you can see this article:CNZZ website Traffic Statistics principle Analysis

Cnzz code add element to page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.