Forum Moderators: open

Message Too Old, No Replies

Inputting similar pages

Possible arrays?

         

oceanwave

5:05 pm on Oct 15, 2004 (gmt 0)

10+ Year Member



Hi,

I have the same page literally duplicated over a hundred times, except for three items: 2 jpgs, and 1 mp3. Is there a simpler way to do this, perhaps using arrays (instead of creating all the html pages)?

In other words:
"pic1.jpg","pic1b.jpg","sound1.mp3" would go on one page.
"pic2.jpg","pic2b.jpg","sound2.mp3" would go on the next page.
"pic3.jpg","pic3b.jpg","sound3.mp3" would go on the next page, etc.

Would I be able to have only one html page with all hundred sets of input (keeping the three assigned set items together)?

Could the page selected be displayed randomly (from the hundred page sets)? In other words, the page with ("pic3.jpg","pic3b.jpg","sound3.mp3") might be displayed first,("pic29.jpg","pic29b.jpg","sound29.mp3") might be next, etc.

It sounds like php, but can javascript do this?

qlipoth

7:39 pm on Oct 15, 2004 (gmt 0)

10+ Year Member



Well, you COULD dump all the values into three arrays in order, then pick a number from 0 to ubound at random and read it back out.

But really... why would you want to do this in javascript? This would be much better suited to a server-side language like php or ASP.