Script like google Ads needed. to display random HTML code.
Hi,
I owe a website... a quite popular one.. and i want a script which can display different Javascript ad codes randomly like... i saw and random image script to display random images but i didn't find any for displaying random HTML code or Javscript code...
Thanks in Advance!
Help is Definately On the Way
Here is a small code I developed. For any other viewers, please notify if there are any errors.
Code:
<html>
<head>
<title>
NONE
</title>
<script language="JavaScript">
function load_differ()
{
var numb = Math.round(Math.random()*3-.5);
document.getElementById('frame').src="ad_num_"+numb+".html";
}
</script>
</head>
<body onload="load_differ()">
<iframe width="200" height="125" src="none.html" id="frame">
</iframe>
</body>
</html>
Hope it gives you an idea of what you'll need. Oh, and you can edit the code. You also might want to create three HTML files with the names of "ad_num_0.html", "ad_num_1.html", and "ad_num_2.html". You are welcome in advance. Any questions or code requests? E-mail me: magicyte.programmer@gmail.com
-magicyte
HMMMMM... No problems at all...
What I meant by creating those HTML files ... those files SHOW YOUR ADS that you will be showing ... you just make your own little advertisements and maybe put a cute little link to some place. Also: You can reduce the number of ad pages by changing the 3 on line 9, char 37 ...
Code:
<html>
<head>
<title>
NONE
</title>
<script language="JavaScript">
function load_differ()
{
var numb = Math.round(Math.random()*3-.5);
document.getElementById('frame').src="ad_num_"+numb+".html";
}
</script>
</head>
<body onload="load_differ()">
<iframe width="200" height="125" src="none.html" id="frame">
</iframe>
</body>
</html>
... to any other number to display different html pages. Of course you would need to create more html pages with the name ad_num_(some integer).html. Just saying that you will need to create those files needed. Oh, by the way... would you mind letting the people on your website know that an eleven year old boy made the code? Of course it's illegal to use other people's codes without leaving the notice saying that you must leave the notice in the code, or else. Could you just let them know? Please. Plz. Thanx if you do. By the way... what website do you own? Maybe I will let people know about it if you do what I asked. Actually, I will! Well, 'tis a pleasure doing business with you! E-mail me magicyte.programmer@gmail.com if you have any concerns, comments, or problems. I can also whip up some more code for you if you wish... Also, would you mind thanking me one more time, just to get my reputation up? Thanx! Anyway, you are welcome for everything!
-magicyte
P.S. - Here is a sample code for ad_num_0.html:
Code:
<html>
<head>
<title>
Ad 1
</title>
<script language="JavaScript">
function red(obj)
{
obj.style.color="red";
}
function blue(obj)
{
obj.style.color="blue";
}
</script>
</head>
<body>
<a style="font-family:Courier New;font-size:14px;color:blue;cursor:hand;" onmouseover="red(this)" onmouseout="blue(this)" onclick="red(this)" href="http://www.jimswarehouse.com/" target="_top">
Jim's Warehouse
</a>
Buy stuff today at Jim's Warehouse! You get lots for less!
</body>
</html>
I figured you could duplicate it, change it up, and use it for the other ad pages. Hope it helps!