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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Apr 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Random Number Generator

    I need help with a random number generator. Here is an excerpt of an email I received of what it needs to do:

    CACHE BUSTING: To ensure accurate tracking, you are required to implement a Cache Buster on these placements by replacing all occurrences of [CACHEBUSTER] in the ad tags below with a value using one of the following two Cache Buster types:

    1. Time Date Stamp (down to the millisecond or smaller time interval)
    2. Random Number Generator (at least 4 digits)

    The Cache Buster value must be identical on all ad tag components for each ad placement.

    Proper cache busting ensures the correct click thru URLs are delivered, and ensures correct banner weighting/rotation.
    This is for a banner obviously. So it has to have at least 4 digits and something that I can just put in place of [CACHEBUSTER] in my code.

    I really appreciate any help as I haven't a clue on how to do this.

  • #2
    Regular Coder
    Join Date
    Mar 2003
    Posts
    176
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the random number:
    Code:
    <script language="jav&#97;Script">
    <!-- ;
    function getR() {
    return Math.random().toString().substring(2,6)
    }
    // end hide -->
    </script>
    Just call the function
    Code:
    getR()
    in place of cachebuster.
    Last edited by HairyTeeth; 04-02-2003 at 04:08 PM.

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Or, if you want the timestamp

    function getR()
    {
    return new Date().getTime();
    }
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #4
    New to the CF scene
    Join Date
    Apr 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks a lot! I'll give these a try!


  •  

    Posting Permissions

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