站长统计没有自带隐藏前台“站长统计”文字的功能,这2字在我们页面中时而多余时而碍眼,所以90%以上的用户都会想办法去除或隐藏“站长统计”四个字。
7 X, P3 m0 q6 w& T最常见的是把统计代码放在一个DIV中,然后填写class再用样式块隐藏,还有比较常见的就是直接给div写内嵌样式隐藏整个div然后把统计代码放入div中。如:) E' j( A9 z2 N; f8 f) u
- <div style="display:none">3 w, c, K1 `2 N. C+ X# U' ^
- <script src="http://s5.cnzz.com/stat.php?id=5844924&web_id=5844924" language="JavaScript">
% f5 s! p- @: r, H/ I, A" E. P1 h - </script>/ f( c! d2 \8 s+ o5 u c
- </div>: ?# j2 W, g# U
众所周知,使用display:none对搜索引擎来说是不友好的,所以避之为吉,能避免使用就避免使用,因为对于搜索引擎来说可以隐藏有作弊嫌疑。9 G' o9 ~4 l1 \' ~/ C8 t/ b- w
获取到的默认代码
+ ?4 u) F& T- W- <script type="text/javascript">, v1 Q+ Y0 x9 b1 ?
- var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");" V- ?4 _' m, G1 Y
- document.write(unescape("%3Cspan id='cnzz_stat_icon_5844924'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s5.cnzz.com/stat.php%3Fid%3D5844924' type='text/javascript'%3E%3C/script%3E"));
% v. N% F+ @2 E& P0 ?3 H# b - </script>
& N9 T ~) L: y6 k
巧妙去除站长统计文字链接.jpg
/ \% u4 e' y: C' ?+ u
在获取统计代码是我们选择默认代码而不是精简代码,如上图
, m8 W( I, R* W% c2 x修改后的默认代码
' d- ?1 F+ k T! V. X! R4 s- <script type="text/javascript">. J1 D! }$ `+ w) }. t/ R
- var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan style='display:none;' id='cnzz_stat_icon_5844924'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s5.cnzz.com/stat.php%3Fid%3D5844924' type='text/javascript'%3E%3C/script%3E"));" D) ^* N' c Y( |
- </script>' M; H! \2 R9 c
在document.write(unescape("%3Cspan与id='cnzz_stat_icon_之间增加style='display:none;'
+ B9 N1 d9 I9 w4 {' _! W或者是直接复制这里修改过的默认代码然后修改ID为你网站的统计ID,有2处要修改,分别是id='cnzz_stat_icon_5844924'和stat.php%3Fid%3D5844924,把5844924修改成你网站的统计id就可以了。
* k- d: g+ o& c) E, a增加一段js隐藏站长统计文字链接
0 q* G/ ^, B" f4 \* i9 {3 L" L在获取的统计代码最后,也就是</script>前面,加一段:
3 b2 S9 U j+ a, f- document.getElementById("cnzz_stat_icon_5844924").style.display = "none"; }4 c7 `' V6 ~
在保存前记得修改站点统计ID,将5844924修改为你的站长统计网站统计ID即可,不知子曰开始是用这种方法,现在用前面介绍的那种,相比前者比后者更好。
! |6 s6 B8 \4 O$ @ 注:相关网站建设技巧阅读请移步到建站教程频道。 |