Results 1 to 8 of 8

Thread: Script like google Ads needed. to display random HTML code.

  1. #1
    Join Date
    Apr 2008
    Location
    Little Office!
    Posts
    80
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Smile 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!

  2. #2
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default 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

  3. The Following User Says Thank You to magicyte For This Useful Post:

    chetanmadaan (06-23-2008)

  4. #3
    Join Date
    Apr 2008
    Location
    Little Office!
    Posts
    80
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    two problems what i think...
    ad_num_0.html, 1 and 2 are not listed in the script... the files will be in the same directoy or other... can you create them and send me as a attachment and i will just edit the Html ad files?/

    thanks!

  5. #4
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default 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!
    Last edited by magicyte; 06-24-2008 at 03:33 AM. Reason: I forgot to add something - an example

  6. The Following User Says Thank You to magicyte For This Useful Post:

    chetanmadaan (07-02-2008)

  7. #5
    Join Date
    Apr 2008
    Location
    Little Office!
    Posts
    80
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    but how about creating none.html or something it is showing up error for none.html please check here...
    http://dloadmp3.com/ads_Check/

  8. #6
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    First of all, none.html DOES NOT EXIST. You are to make your own HTML page called none. And that is not even why there is an error there is an error because when it took numb, the variable, there was something wrong with it. You changed up the code, it appears. This is the original code:

    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>
    and this, my friend, is the warped code (the changed up code):

    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>
    Look at the warped code carefully and compare it with the original code. Any differences? The problem is highlited in the next code. Its coordinates are found at LINE 9, CHARACTERS 36 and 39:

    Code:
    1:   <html>
    2:   <head>
    3:   <title>
    4:   NONE
    5:   </title>
    6:   <script language="JavaScript">
    7:   function load_differ()
    8:     
    9:  var numb = Math.round(Math.random()**3*-.5);
    10: document.getElementById('frame').src="ad_num_"+numb+".html";
    11: }
    12: <script>
    13: </head>
    14: <body onload="load_differ()">
    15: <iframe width="200" height="125" src="none.html" id="frame">
    16: </iframe>
    17: </body>
    18: </html>
    The highlited part is your problem. It should be

    var numb = Math.round(Math.random()*3-.5);

    and NOT

    var numb = Math.round(Math.random()**3*-.5);

    But that is just the beginning. I was wondering if you had even uploaded the other HTML files named ad_num_0.html, ad_num_1.html, and ad_num_2.html. If you hadn't, then please do so. If you hadn't created the HTML files, please do so. If you hadn't created a blank HTML page named none.html, please do so. Everything should be solved. You may PM or e-mail me by using the links in my signature. Hopefully all of my help helped.

    -magicyte
    Last edited by magicyte; 07-02-2008 at 02:39 AM. Reason: NONE

  9. The Following User Says Thank You to magicyte For This Useful Post:

    chetanmadaan (07-02-2008)

  10. #7
    Join Date
    Apr 2008
    Location
    Little Office!
    Posts
    80
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    Thanks for that.... Its works perfectly fine now...

    Good Work!

  11. #8
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    You are very welcome for all of the help I gave you. If you have any more questions on ANYTHING, please, feel free to PM me or e-mail me using the links in my signature. By the way... I am a young boy. If you wish to have me help you with any professional projects, reassure yourself for complete satisfaction. Even so, I am an experienced programmer, and I can help you with a lot. Simply ask.

    -magicyte

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •