[Happy to original]chrome error a parser-blocking, Cross-origin script, http://s11.cnzz.com/stat.php?id=XXXXXX&show=

Source: Internet
Author: User

Since the upgrade of Chrome, inadvertently found that the console under the total annoying tips, is CNZZ statistics.

Look, the current version of Chrome is: Version 56.0.2924.87


To be exact, this annoying CNZZ content tip is as follows:

A parser-blocking, Cross-origin script, Http://s11.cnzz.com/stat.php?id=XXXXXX&show=pic, is invoked via document.write. This is blocked by the browser if the device has poor the network. https://www.chromestatus.com/feature/5718547946799104 for more details.
(anonymous) @ (index): 593

As shown in the following picture:


The original statistic code is shown below:

<script type= "Text/javascript" >var cnzz_protocol = ("https:" = = Document.location.protocol)? "https://": "http: ");d Ocument.write (unescape ("%3cspan id= ' cnzz_stat_icon_2247638 '%3e%3c/span%3e%3cscript src= ' "+ Cnzz_protocol +") s11.cnzz.com/stat.php%3fid%3d2247638 ' type= ' text/javascript '%3e%3c/script%3e ');</script>

The figure below is as follows:



The reason for the error is: After the page rendering is finished using the document.write () (Cnzz statistic Code), chrome53 the above version will give an error. )。

Solution: Change the statistic code to asynchronous loading

The new statistic code is as follows: (note replaces the Red XXX ID for own statistic station in point ID)

<!--CNZZ Stats-->
<script type= "Text/javascript" >
var Cnzz_s_tag = document.createelement (' script ');
Cnzz_s_tag.type = ' Text/javascript ';
Cnzz_s_tag.async = true;
Cnzz_s_tag.charset = ' utf-8 ';
CNZZ_S_TAG.SRC = ' https://w.cnzz.com/c.php?id=XXXXX&async=1 ';
var root_s = document.getelementsbytagname (' script ') [0];
Root_s.parentNode.insertBefore (Cnzz_s_tag, root_s);
</script>

The figure below is as follows:


After the upload: Check again, OK, only refreshing, no annoying tips.



The result is a mark.

2017-03-27

This article address: http://blog.csdn.net/aerchi/article/details/66969377

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: info-contact@alibabacloud.com 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.