As a small website, placing various advertisements on the page is a matter of course. We use the Baidu alliance. Previously, it was Google's Adsense. Google is in the palace of tianchao, and since the Chinese people, it seems that Baidu is the only choice.
Then, as a small website, it is natural to place 10 8 advertisements on the page. This means that there will be 10 8 <scripts> for each page, plus other script links, CSS links, and images. Wow, open your page and there are a lot of requests. It's like marrying a wife and having a couple of children with her ex-husband, as well as three aunts in the family. It's disgusting. This is the secret of our website.
In the October revolution, Baidu prepared an optimized statement for us, that is, no matter how many Baidu AD Alliance code you put on the page, it can be included in a request. The Code is as follows:
<script>BAIDU_CLB_preloadSlots("213888", "216888", "214888", "214888", "317888","216888", "216888", "216888", "267888");</script>
The number is the ID of the advertisement.
The format is as follows:
[HTML]
View plaincopyprint?
- <Head> <title> beauty in bed </title>
- <Script
Type = 'text/JavaScript'
Src = 'HTTP: // cbjs.baidu.com/js/m.js'> </SCRIPT>
- <PRE
Id = "line16"> <Span
Class = "start-tag"> script </span> baidu_clb_preloadslots ("213888 ",
"216888", "214888", "214888", "317888", "216888", "216888", "216888", "267888"); </<Span
Class = "End-tag"> script </span>
- <Link
Href = "/CSS/default.css? Ver = 120308"
Rel = "stylesheet"
Type = "text/CSS">
- </Head> </PRE>
<Head> <title> beauty in bed </title> <SCRIPT type = 'text/JavaScript 'src = 'HTTP: // cbjs.baidu.com/js/m.js'> </SCRIPT><script>BAIDU_CLB_preloadSlots("213888", "216888", "214888", "214888", "317888","216888", "216888", "216888", "267888");</script><link href="/css/default.css?ver=120308" rel="stylesheet" type="text/css">[HTML]
View plaincopyprint?
- <Body>
- <Div>
- <Table
Id = "ms_tbad"
Style = "border: none;"> <tr>
- <TD> <script
Type = "text/JavaScript"> baidu_clb_fillslot ("216888"); </SCRIPT> </TD>
- <TD> <script
Type = "text/JavaScript"> baidu_clb_fillslot ("216888"); </SCRIPT> </TD>
- <TD> <script
Type = "text/JavaScript"> baidu_clb_fillslot ("216988"); </SCRIPT> </TD>
- </Tr>
- </Table>
- </Div>
- </Body>
<body><div> <table id="ms_tbAd" style="border:none;"><tr> <td><script type="text/javascript">BAIDU_CLB_fillSlot("216888");</script></td> <td><script type="text/javascript">BAIDU_CLB_fillSlot("216888");</script></td> <td><script type="text/javascript">BAIDU_CLB_fillSlot("216988");</script></td> </tr> </table></div></body>
Of course, if there is only one baidu_clb_fillslot, it is not necessary to write this one request statement.
From: http://blog.csdn.net/leftfist/article/details/7335127