The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
I am trying to make a jokes page which has one joke displayed and then when the visitor clicks on next it shows a different joke and then they click again and it shows a different joke but it is still on the same page. What would be the easiest way to do this. Preferably using some sort of HTML.
The array section is for both example.
document.JokeForm.JokeBox.value = Jokes[Number];
= is just for the first example.
if (! document.layers && ! document.all) return;
if (document.layers) {
document.layers.JokeArea.document.write(Jokes[Number]);
document.layers.JokeArea.document.close();
} else if (document.all) {
JokeArea.innerHTML = Jokes[Number];
}
= is for the second example.
You can of course alter the html and colours, I picked pink just because it was the first light colour I thought of to show what area was being covered.
-----------------------------
... OR ...
[Another Joke]
(correct me if I'm wrong someone - this is all from memory)
Save your jokes on separate HTML files, and then in the page you want to display the frame, you must put in the HTML code:
Then, on each of your joke pages you'll need to put this in the header section:
The 20 is just the time in seconds, you could also do this via a normal link, but it sort of defeats the purpose then.
I think that's allright, if you get any probs I'll do my best to work out where I went wrong :)
You could use the array, as he said although I'm not sure that's the code to create an array, I always thought you had the information inside it in square brackets like this:
jokes = new Array["joke1", "joke2" etc]
Then use the math.random thing to:
(not sure i've got the code for this right, but the idea's here: )
randomNumber = math.randomsomthingorother
document.write(jokes[randomNumber]), then, could you use an onClick in a font tag or something to re-write that document.write, so hopefully a new joke appears?
The idea's here, but not too sure about the code
I just copied this, dunno what it does...
I am trying to make a jokes page which has one joke displayed and then when the visitor clicks on next it shows a different joke and then they click again and it shows a different joke but it is still on the same page. What would be the easiest way to do this. Preferably using some sort of HTML.