Call the advertisement display file from js pulled by Netease
Only a few lines of code below can randomly display flash and gif ads, not bad
Copy codeCode: function column02 (imgSource, url, chance, type ){
This. imgSource = imgSource;
This. url = url;
This. chance = chance;
This. type = type;
}
Function dispColumn02 (){
With (this)
Switch (type ){
Case "img ":
Document. write ("<a href =" + url + "target = _ blank> </A> ");
Break;
Case "html ":
Document. write ("<iframe width = 480 HEIGHT = 250 MARGINWIDTH = 0 MARGINHEIGHT = 0 HSPACE = 0 VSPACE = 0 FRAMEBORDER = 0 SCROLLING = no BORDERCOLOR = #000000 SRC =" + imgSource +"> </iframe> ");
Break;
Case "flash ":
Document. write ("<embed src =" + imgSource + "quality = high width = 480 height = 250 type = application/x-shockwave-flash pluginspage = http://www.macromedia.com/shockwave/download/index.cgi? P1_Prod_Version = ShockwaveFlash> </embed> ");
Break;
Default:
Document. write ("");
}
}
Column02.prototype. dispColumn02 = dispColumn02;
Columns02 = new Array ();
// Flash, html, and img represent three different ad Modes
// The number of 200 is the probability of occurrence.
Columns02 [0] = new column02 ("http://smsimg.163.com/honey/honey_ad.swf", "", 200, "flash"); // ad
Columns02 [1] = new column02 ("http://smsimg.163.com/honey/honey_photo.swf", "", 800, "flash"); // upload images for rent-free monthly
Columns02 [2] = new column02 ("http://smsimg.163.com/honey/honey_gold.swf", "", 800, "flash"); // login to send gold coins
// Columns02 [] = new column02 ("f", "", 100, ""); // (20030422 ~ 20030722)
Sum_of_all_chances = 0;
For (I = 0; I <columns02.length; I ++ ){
Sum_of_all_chances + = columns02 [I]. chance;
}
Function randomColumn02 (){
Chance_limit = 0;
Randomly_selected_chance = Math. round (sum_of_all_chances-1) * Math. random () + 1;
For (I = 0; I <columns02.length; I ++ ){
Chance_limit + = columns02 [I]. chance;
If (randomly_selected_chance <= chance_limit ){
Columns02 [I]. dispColumn02 ();
Break;
}
}
}
This_column02 = randomColumn02 ();
The larger the chance, the higher the chance of displaying the code.
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]