Forum Moderators: open

Message Too Old, No Replies

Random Page

How to get a button to select a random page in a folder

         

oceanwave

5:25 pm on Oct 9, 2004 (gmt 0)

10+ Year Member



I have an image that I am using as a button. On mouseover, audio directions are given to the user.

<a href="http://mysite.com" onMouseOver="audioDo('play','page')"
onMouseOut="audioDo('stop','page')">
<img border="3" src="button.JPG"></a>

Is there a way to have the user click this button to go to a random page located in the same folder? The folder presently contains the html pages, images, and sound files, so I would have to specify the page names.

orion_rus

7:29 am on Oct 12, 2004 (gmt 0)

10+ Year Member



Make a function and add onmouseclick in this button with reference to this function, like javascript:...

oceanwave

11:27 am on Oct 12, 2004 (gmt 0)

10+ Year Member



Thanks so much for responding.

Yes, I would like to make a function but I am not sure the best way to go about it. The page is loading slowly as it is.

orion_rus

1:06 pm on Oct 12, 2004 (gmt 0)

10+ Year Member



I think all what u need is a small function with random and case, i don't see better decision:(( or u can make a onload function there u choose ur link, and parse it into the link <a>

oceanwave

5:40 pm on Oct 13, 2004 (gmt 0)

10+ Year Member



I found this on the Javascript Kit website: [javascriptkit.com...] What I would like to know is, is this the best way to choose a random page while maintaining a fast page load?

***I just spent a few hours editing my page to increase the loading speed. I had to remove a lot of the audios (I had audio directions throughout the page) because the page load time was unreal.

orion_rus

5:51 pm on Oct 13, 2004 (gmt 0)

10+ Year Member



yes, i think it's the best idea that u can use, but u should know what "javascript:..." wouldn't work if browser off his jscript using. what's why i advice u to make a <a> link with onclick event.

oceanwave

8:03 pm on Oct 13, 2004 (gmt 0)

10+ Year Member



Thanks for answering orion_rus. I'm not sure if I understand you.

Are you saying I should use a button link with an onclick, rather than a text link, or are either okay? The script I suggested above gives the code for either of these two inputs.

orion_rus

9:34 pm on Oct 13, 2004 (gmt 0)

10+ Year Member



You need to use <a> link with href and event onclick=javascript:rendomhref();
I think it would be best