Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rotating a list of items

Status
Not open for further replies.

lahddah

Programmer
Jan 2, 2003
109
US
Hi.
I have a list of clients that I want to display on and HTML page. However, on refresh, I would like that list to rotate so that the client that is on the top isn't always on the top. Perhaps have them shuffle, or just have the top go to the bottom and everything else moves up. The list contains paragraphs, each of which contains the client name, address, website, and description of services.

Does anyone know of a script that will do this?

Thanks!


~ lahddah
 
Javascript only... or do you have server-side scripting available?

I'm asking that because some languages have ready-to-use content rotators.
 
You can build that with a Javascript array of the clients, and sort the array randomly. But I'd think it'd be better done with server-side scripting like vongrunt said.
 
Thanks, vongrunt and trollacious, for your quick response! I was originally going to use ASP, but they want the page to have an 'htm' extension to make it easier for readers to remember as the address will go out in a newsletter type thing. So, I thought I'd try javascript. The server that I am using it on does not support perl, so it's either ASP or javascript, I'm afraid.

Thanks!

~ lahddah
 
If you have the option of using ASP, I will third the notion that you use it. Server-side scripting is much faster and neater than JavaScript, and will work for 100% of your users, since they cannot disable ASP.

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
You can set a server up to run .HTM pages through a PHP processor, too, I believe. I don't know if you could get away with using

<script language="vbscript" runat="server">

</script>

to get things accomplished server-side on .HTM pages or not.
 
Thanks, all! I think I'll just make a static HTM page that forwards to the dynamic ASP page, then. Shouldn't be too jarring for the user, I hope.

Thanks, again!


~ lahddah
 
Configuring IIS to process .htm files as if they were ASP is easy enough.[ol][li]Open IIS[/li][li]Open the properties of the site to configure[/li][li]Click the "Configuration..." button on the Home/Virtual Directory tab[/li][li]Add or edit the .htm extension to match the settings of the .asp extension[/li][/ol]That's it! You might also have to restart IIS.

Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 
That works if it's YOUR server, or you can convince your web hosting service to set their server up that way.
 
Hmm..interesting. I do have access too IIS configuration through terminal services, but I don't think I'm comfortable enough to go in an tweak things to this extent. Would doing as you suggested change the action for all HTM pages?

~ lahddah
 
You could create a separate virtual directory and change the settings for only file in that directory.

Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top