• Nike free run 2 pink
  • Nike free 5.0 kids
  • Oakley sunglasses discount
  • CodeAve.com CodeAve.com - JavaScript - Misc
    ASP
    JavaScript
    ·Document Info
    ·Forms
    ·Images
    ·Miscellaneous
    ·Navigation
    ·Script Writers
    ·Contents
    ·What's New?
    CSS
    HTML
    Maps
    Links
    Mail List
    Search
    Sitemap


     

  • Retro 3 jordans
  • Jordan 13 retro
  • Nike free 5.0

  • Random Text (IE)
  • Air jordan 11 low
  • New Balance 996
  • Ray ban vintage sunglasses
  • Rotating text ads, a random quote, or most anything can easily be done on the client and not use any scripting on the server side to give a "dynamic" look to your pages.  Actually, once you have random text you can insert most any html and have that become part of a randomized display. The example below has ten text strings that will be randomly selected for display.  A couple of them have some simple text formatting commands to demonstrate the ability to insert html in the text.  There is also a variable (number) that is used to accumulate all of the possible random selections.  So, rather than having to change the maximum value every time you add or remove random text, it will be calculated on each iteration.  Keep n mind, all of your random selections are being fed to the client and it is making a decision on which one to display, so you are serving more text than you would in a server side scenario and it's best not to have scores upon scores of random text possibilities just gumming up the download.
    View the Output
    Text View
    Print View
    Mail this Link
    Download the Code

    <html>
    <title>
    CodeAve.com(Random JavaScript Text)</title>
    <body bgcolor=
    "#FFFFFF">
    <script language
    ="JavaScript">
    <!--
    function random_text()
    {};
    var random_text = new random_text();
    // Set the number of text strings to zero to start
    var number = 0;
    // Incremental list of all possible Text
    random_text[number++] = "<font color='#FF0000'>Random JavaScript Text #1</font>"
    random_text[number++] = "Some More Random JavaScript Text #2"
    random_text[number++] = "Another Random JavaScript Text #3"
    random_text[number++] = "A Different Random JavaScript Text #4"
    random_text[number++] = "<b>Random JavaScript Text #5</b>"
    random_text[number++] = "<i>Random JavaScript Text #6</i>"
    random_text[number++] = "<font color='#00FF00'>Random JavaScript Text #7</font>"
    random_text[number++] = "<a href='#'>Random JavaScript Text #8</a>"
    random_text[number++] = "<font color='#CC33FF'>Random JavaScript Text #9</font>"
    random_text[number++] = "<font color='#0000FF'>Random JavaScript Text #10</font>"
    // Create a random number with limits based on the number
    // of possible random text strings
    var random_number = Math.floor(Math.random() * number);
    // Write out the random text to the browser
    document.write(random_text[random_number]);
    -->
    </script>
    <br><br>
    Click <a href="javascript:history.go(0);">refresh</a> to see more random text.
    </body>
    </html>

     

     

     



    ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
    Server Variables | Response Objects | Random Events | Miscellaneous
    HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
    JavaScript: Document Info | Forms | Images | Navigation | Script Writers
    CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement

    CodeAve.com is hosted by MyHosting.com
    Donate Food Online with a Mouse Click at TheHungerSite.com
    Donate Land Online with a Mouse Click at TheRainForestSite.com
    © 1999 - 2014 CodeAve.com
    All Rights Reserved

    jordan 11 gamma Nike KD VI lebron 11 low