13922Random Stringshttp://www.raingod.com/raingod/resources/Programming/JavaScript/Software/RandomStrings/index.htmlInterpolate a random string into a page when it is displayed. This technique could be used as an alternative to server-side includes for those who don't have them or don't want to overload the server. The disadvantage, of course, is that all the alternatives have to be downloaded, so you're loading a lot of unnecessary information just to display one string.
In a real example, the 'cannot be displayed' message (which you will see if you don't have a Java-capable/enabled browser, or if you're running Navigator 2.0) should usually be replaced by a default string.JavaScript > Scripts and Programs > Randomizing > Random TextOct 12, 2006
Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Apple-s). The script is yours!!!
This page written with Java Script selects a random image from a set of images. If you want, you can specify a URL to go with it. If you use it, I would appreciate (but not require) a link back to my home page. Thanks!
Interpolate a random string into a page when it is displayed. This technique could be used as an alternative to server-side includes for those who don't have them or don't want to overload the server. The disadvantage, of course, is that all the alternatives have to be downloaded, so you're loading a lot of unnecessary information just to display one string.
In a real example, the 'cannot be displayed' message (which you will see if you don't have a Java-capable/enabled browser, or if you're running Navigator 2.0) should usually be replaced by a default string.
This script loads a different page into an iframe daily, depending on the day of the month (1-31). Use it to serve up daily, changing content, such as a "tip of the day." See also "Daily Iframe Content 1", which has a shorter range of weekly (Mon-Sun). The script now offers optional code to auto resize iframe based on height of content within. New!
This script randomly selects from a group of URLs and displays one of them inside an iframe. Since it's an iframe, the content can be anything and everything. Some ideas for using this script are:
Joining mailing list will entitle you
to receive occasional emails informing you of news and
updates to the site and any special offers that may be
of interest to you.