How to optimize your Web advertising code and speed

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

How do I create multiple ad bits? In JS Riga:

<div class=ggad><span id= "K_ad_chongzhi" ></span><script type= "Text/javascript" >gethtm ('/ Adfile/chongzhi.htm ', ' K_ad_chongzhi ');</script></div></div>


I am more curious, I am using <script src= "/ad/xxx.js" type= "text/javascript" ></script> load ads sometimes to load this section of JS will be the main card, so I want to change to So he went to the internet to search. Search for half a day only to the article is also with my friend almost shows the load Flash code <script type= "Text/javascript" >g_flash (' http://www.freejia.com /plus/free/xxx.swf ', 468x60,0);</script> is referenced with a JS file, but its width is fixed. Later, we should also consider this issue to change the advertisement. So I have changed the code nonsense not much to tell you how to get it!

First create a JS file content is:


Document.writeln ("<script type=\" text\/javascript\ ">   ");
Document.writeln ("  ");
Document.writeln ("   function G_banner (url,transparent) {   ");
Document.writeln ("   \/\/Clear active line of the Flash for ie   ");
Document.writeln ("     var param_t=\ ';   ");
Document.writeln ("     if (transparent!=0) {   ");
Document.writeln ("         param_t=\ ' wmode=\" transparent\ "\";     ");
Document.writeln ("     }   ");
Document.writeln (document.write (\ <iframe src=\ "\ +url+\ ' \"; width=\ "468\" height=\ "60\" scrolling=\ "no\") Frameborder=\ "0\" ><\/iframe>\ ")
Document.writeln ("   }   ");
Document.writeln ("<\/script>")


Then insert the HTML page, insert the top <script src= "Xxx.js" type=text/javascript></script>

Between the body Insert script type= "Text/javascript" >g_banner (' http://www.freejia.com/plus/free/banner.html ', 0); </script > On the line! Width height in JS control convenient for us to modify

How do I create multiple ad bits? In JS Riga:

Document.writeln ("<script type=\" text\/javascript\ ">   ");
Document.writeln ("  ");
Document.writeln ("   function G_banner (url,transparent) {   ");
Document.writeln ("   \/\/Clear active line of the Flash for ie   ");
Document.writeln ("     var param_t=\ ';   ");
Document.writeln ("     if (transparent!=0) {   ");
Document.writeln ("         param_t=\ ' wmode=\" transparent\ "\";     ");
Document.writeln ("     }   ");
Document.writeln (document.write (\ <iframe src=\ "\ +url+\ ' \"; width=\ "468\" height=\ "60\" scrolling=\ "no\") Frameborder=\ "0\" ><\/iframe>\ ")
Document.writeln ("   }   ");
Document.writeln ("<\/script>")

Document.writeln ("<script type=\" text\/javascript\ ">   ");
Document.writeln ("  ");
Document.writeln ("   function G_tl (url,transparent) {   ");
Document.writeln ("   \/\/Clear active line of the Flash for ie   ");
Document.writeln ("     var param_t=\ ';   ");
Document.writeln ("     if (transparent!=0) {   ");
Document.writeln ("         param_t=\ ' wmode=\" transparent\ "\";     ");
Document.writeln ("     }   ");
Document.writeln (document.write (\ <iframe src=\ "\ +url+\ ' \"; width=\ "950\" height=\ "60\" scrolling=\ "no\") Frameborder=\ "0\" ><\/iframe>\ ")
Document.writeln ("   }   ");
Document.writeln ("<\/script>")
 


See, two quoted G_banner g_tl <script type= "Text/javascript" >g_banner (' http://www.freejia.com/plus/free/ Banner.html ', 0;</script>

<script type= "Text/javascript" >g_tl (' http://www.freejia.com/plus/free/banner.html ', 0);</script>


In this way can be removed from JS parsing the code time, directly open HTML also does not need a JS modification, we only use a JS can control the whole station ads, because this is all of a sudden open all the ads page will feel a bit slow that we in HTML to join the network circulated <span ID =ad_01> ads loaded in ...</span>
<span Class=spanclass id=span_ad_01>
Advertising Code
</SPAN>
<script>ad_01.innerhtml=span_ad_01.innerhtml;span_ad_01.innerhtml= "";</script>


The speed will be faster than the original, OK, this end! I am careful to write articles for the first time not to scold me!

Under their own station, free home http://www.freejia.com everyone support ha!

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.