<div align="right"><!-- zhaiyiming.com CNZZ tongji analytics -->
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "s11.cnzz.com/stat.php?id=3406426&web_id=3406426&show=pic' language='JavaScript'%3E%3C/script%3E"));
</script>
<!-- zhaiyiming.com Baidu tongji analytics -->
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Ff6d43854ba1941db354e1c786d275b73' type='text/javascript'%3E%3C/script%3E"));
</script>
<!-- zhaiyiming.com 51la tongji analytics -->
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript language='javascript' src='" + _bdhmProtocol + "js.users.51.la/4922982.js' type='text/javascript'%3E%3C/script%3E"));
document.write(unescape("%3Cnoscript%3E%3Ca href='http://www.51.la/?4922982' target='_blank'%3E%3Cimg alt='我要啦免费统计' src='http://img.users.51.la/4922982.asp' style='border:none' /%3E%3C/a%3E%3C/noscript%3E%3C/script%3E"));
</script>
<!-- zhaiyiming.com tongji analytics End --></div>
<script type="text/javascript">
/*
* 根据元素clsssName得到元素集合
* @param fatherId 父元素的ID,默认为document
* @tagName 子元素的标签名
* @className 用空格分开的className字符串
*/
function getElementsByClassName(fatherId,tagName,className){
node = fatherId&&document.getElementById(fatherId) || document;
tagName = tagName || "*";
className = className.split(" ");
var classNameLength = className.length;
for(var i=0,j=classNameLength;i<j;i++){
//创建匹配类名的正则
className[i]= new RegExp("(^|\\s)" + className[i].replace(/\-/g, "\\-") + "(\\s|$)");
}
var elements = node.getElementsByTagName(tagName);
var result = [];
for(var i=0,j=elements.length,k=0;i<j;i++){//缓存length属性
var element = elements[i];
while(className[k++].test(element.className)){//优化循环
if(k === classNameLength){
result[result.length] = element;
break;
}
}
k = 0;
}
return result;
}
window.onload = function(){
var e=getElementsByClassName(document,"div","c_ad_block");
if(e){if(typeof(e.length)=='undefined'){e.parentNode.removeChild(e);}else{for(var i=0;i<e.length;i++){e[i].parentNode.removeChild(e[i]);}}}
}
</script>
版权属于:一名宅。
本文链接:https://zhaiyiming.com/archives/javascript-remove-cnblogs-advertisements-by-tinymins.html
转载时须注明出处及本声明