JS BUG! Please Reload!

by Florence W. Deems
::: ::: :::

If you want to put random quotes or other types of text on a webpage, here's a very easy script to use. You put this script on a separate page and name it something like "Random.html."

Substitute quotes, etc, for letters in the third line:

var r_text = [ ];

Note that each line of text will begin with quotation marks then text then close quotes then a comma:

["text", "text", "text"];

Note also that the last section of text ends with a close quote BUT NO COMMA! Some browsers don't like a last comma!

You can use single line break tags <br> to break up text into shorter lines.

On the page on which you want the random text to appear, simply insert your "Random.html" page wherever on this other page you want the text to appear. You do this the following way:

If your page's extension ends in .html, then use this include tag:

<!--#include virtual="http://yourdomainname.com/Random.html" -->

Remember you can use a "relative" url if you have the Random.html page in the same directory as the page on which you want it to appear:

<!--#include virtual="Random.html" -->

If you make a page with a .php extension, then you must use the include tag below:

<? include('http://yourdomainname.com/Random.html'); ?>

To see an example in action, please click on this page. Scroll down below #9 and the line and that's where you'll see random haiku poems appear. I have the time set for 5000, which means 5 seconds. 15000 means 15 seconds. Set the desired time in the script on this line:

var myInterval = setInterval(doText, 5000);

::: ::: :::

Back to Text Tricks

Website design, text and images,


::: ::: :::

Friday 28th of April 2017 03:48:39 PM

See Flo's Other Tutes

by Tone By Tone Dot Net

Tandem Tables
~ Arbor Hosting ~