Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Code Rotation?

  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    224
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Code Rotation?

    Is it possible in javascript alone (or do I need to use php) to have different code show up each time a user loads the page?

    I want to show different google adsense referral images
    ()
    Every time a user reloads the page.

    The code for one of them is something like this:

    Code:
    <script type="text/javascript"><!--
    google_ad_client = "pub-4346037344594013";
    google_ad_width = 120;
    google_ad_height = 240;
    google_ad_format = "120x240_as_rimg";
    google_cpa_choice = "CAAQufGXhAIaCNsLc8WT4y4qKPG193M";
    google_ad_channel = "";
    //--></script>
    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    How can I make it run a different script every time?

  • #2
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    you could modify this to fit around what you want to do.

    Random Goolge Video...

    all you will need to do is apply your code to the different switch statements.


  •  

    Posting Permissions

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