Based on the script advertisement implementation code in innerHTML [put all advertisements in one js] original

Source: Internet
Author: User

If you do not know how the innerHtml script runs, refer to this article.
Http://www.jb51.net/article/234.htm
The purpose of the following code is to prevent some websites from placing some special advertisements in the script. You can replace them with iframe. You can use post-loading methods to handle ad advertisements.
Recommended code:

Copy codeThe Code is as follows: if (PageClass = 2)
{
// Use iframe to load the 468*60 wildcard bar on the top
Set_innerHTML ('head _ 2_2 ', All_Top_468_60 );
// 468x60 on the top
Set_innerHTML ('head _ 5', All_Top_970_60 );
Temp_Adv = '<iframe scrolling = "no" frameborder = "0" marginheight = "0" marginwidth = "0" width = "240" height = "152"
Src = "/show/html/list_000000004.html" style = "margin-bottom: 5px;"> </iframe> ';
Set_innerHTML ('list _ defaults 1_4 ', Temp_Adv );

// Download the text address on the right + image recommendation
Temp_Adv = '| <a href = "http://www.jb51.net? "Class =" wLink "target =" _ blank "> script home </a> ';
Document. getElementById ("Soft_1_2_4_h2"). innerHTML + = Temp_Adv;
// Set_innerHTML ('soft _ 1_2_1_2 ', Temp_Adv );
}

The above is 4668*60 <p> the above is 4668*602, because the inner is used directly and is not displayed. </P> <p>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

Tests show that it is impossible to add advertisements to scripts that run scripts. Because these scripts are executed later, all script advertisements can be directly written into the script, do not add any more.

However, if other advertisements are used, you can add them to the front. Some websites directly use scripts to control the full-site advertisements. Although this method is not used for the moment, however, we will also refer to this method later.

The most important thing is advertising. You can avoid using scripts as much as possible, and try to use iframe, direct code, image links, and other methods as much as possible.

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.