GetDotted Domains

Viewing Thread:
"Question bout my jokes page."

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.

Sat 05/04/03 at 14:00
Regular
Posts: 787
This is cheeseman on bro's name.

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.
Sat 05/04/03 at 20:39
Regular
"It goes so quickly"
Posts: 4,083
If that's what you want, then pick one over the other, and copy the relevent code:

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.
Sat 05/04/03 at 20:37
Regular
"It goes so quickly"
Posts: 4,083
Why not have a look at this, and see if its in the right direction as to what your after. It'll be easier than using an iframe and having saperate pages for each joke.

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.

-----------------------------

New Document






... OR ...






[Another Joke]
Sat 05/04/03 at 19:10
Regular
"Tornado Of Souls"
Posts: 5,680
You could also use the Math.random in JS to randomise which page is displayed next in the IFrame, but I can't be bothered to go through that right now, and even if you do decide to use it, you'll need to do this first:

(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 :)
Sat 05/04/03 at 18:30
Regular
"^^^New Online Arcad"
Posts: 1,369
that would be ok. how would i do that? i could still say it was random couldnt i because the visitors arent gonna know unless they view it multiple times and realise.
Sat 05/04/03 at 17:42
Regular
"Tornado Of Souls"
Posts: 5,680
You could have that bit in an inline frame in the middle, and have it on a meta refresh to the next joke, or could invoke it via some sort of event, but it's not random, just a sequence.
Sat 05/04/03 at 16:22
Regular
"^^^New Online Arcad"
Posts: 1,369
Isnt there a way to do it with html? with frames or summit?
Sat 05/04/03 at 14:55
Regular
"Tornado Of Souls"
Posts: 5,680
If I get bored and no one beats me to it, i'll have a go at writing something to do it for you.
Sat 05/04/03 at 14:53
Regular
"Tornado Of Souls"
Posts: 5,680
Expanding on what phi11ip said:

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
Sat 05/04/03 at 14:41
Regular
"Chavez, just hush.."
Posts: 11,080
Javascript - Random Text

I just copied this, dunno what it does...



New Document






Sat 05/04/03 at 14:00
Regular
"^^^New Online Arcad"
Posts: 1,369
This is cheeseman on bro's name.

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.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Easy and free service!
I think it's fab that you provide an easy-to-follow service, and even better that it's free...!
Cerrie
Top-notch internet service
Excellent internet service and customer service. Top-notch in replying to my comments.
Duncan

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.