Copyright statement: original works can be reproduced. During reprinting, you must mark the original publication, author information, and this statement in hyperlink form. Otherwise, legal liability will be held. Http://blog.csdn.net/mayongzhan-ma yongzhan, myz, mayongzhan
Failed to get rid of the advertisement of csdn on the blog last time, because csdn adds the most vicious element. style to the advertisement, leading to failure of all the extra styles due to priority issues.
After debugging, I put the style into the page loading and executed it. The result is still not good. I checked the code carefully and found that csdn put the advertisement pop-up in the Js of statistics.
In statistics, a piece of code in Javascript calls another real ad pop-up code, and finally finds that the execution of this Code is also executed after the load is complete. If you want to block the code, you can only execute the hidden code in a delayed manner. This is not very good, because the advertisement will flash a bit (in fact, it is also a method to increase PV, some users feel that something has flashed, and the page is refreshed again due to curiosity ...), Therefore, this method is not feasible.
Looking for a solution, we finally found a way to shield the advertisement code. Because the advertisement presentation involves the revenue of csdn advertisements, the specific implementation is not shown here. It only provides a key point of thinking: element of the advertisement code. style !!!
The following style code is based on the previous version and has not been modified.
The complete style is as follows:
# Csdnblog_allwrap {width: 1000px ;}
# Csdnblog_sidebar {width: 200px ;}
# Csdnblog_sidebar Div. gutter {width: 100%; margin: 0px ;}
. Aboutauthor {padding: 0px; border-left: 0px; border-bottom: 0px; border-top: 0px; border-Right: 1px dotted # AAA ;}
# Csdnblog_content {width: 800px ;}
# Csdnblog_content Div. gutter {}
. Publiclist_sidebar ul Li {margin: 0px; padding: 0px ;}
. Publiclist_sidebar ul Li a {margin: 0px; padding: 0px ;}
. User_article H1 IMG {display: none ;}
. User_article P {text-indent: 0em ;}
. Blogstory P {text-indent: 0em ;}
. Aboutauthor {width: 200px ;}
<Script language = "JavaScript" type = "text/JavaScript" src = "http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js">
</SCRIPT>
<SCRIPT type = "text/JavaScript" src = "/syntaxhighlighter/jquery. highlighter. js"> </SCRIPT>
<Script language = "JavaScript" type = "text/JavaScript">
$ JQ = jquery;
$ JQ ('img [Alt ^ = "XML"]: first'). replacewith ("");
$ JQ ("# search_ddlsearchscope> Option [value! = 'All'] "). ATTR (" selected "," true ");
$ ('# Userinfo '). replacewith ('<DT style = "text-align: left; "> User Information </DT> <dd class =" Middle "> <a href =" http://blog.csdn.net/mayongzhan "> </> </DD> <span style = "display: none; "> <span id =" userinfo "> </span> ');
$ JQ (document). Ready (function (){
VaR blogtitle = $ JQ ('. user_article> H1 ');
VaR blognextprev = $ JQ ("# post //. ascx_viewpost_previusandnextentriesdown ");
If (blognextprev.html ()! = NULL ){
Blogtitle.html(blogtitle.html () + "<div> & nbsp; </div> <div>" + blognextprev.html () + "</div> ");
}
If ($ JQ ('# csdnblog_content>. gutter> script'). length! = 0 ){
VaR csdntempscriptsrc = $ JQ ('# csdnblog_content>. gutter> script') [0]. SRC;
If (csdntempscriptsrc = 'HTTP: // blog.csdn.net/javascript/printnotice.js' | csdntempscriptsrc = '/JavaScript/printnotice. js '){
$ JQ ("script ~ . Default_contents: First ").css ('display', 'None ');
}
}
});
</SCRIPT>