Helping ordinary people create extraordinary websites!

How to Setup a Randomising Function

By Arbitrary Constant
2007-11-17

How to set up a randomising function
A couple of sections on arbitrary constant used to utilise JavaScript in order to generate some random content for that pesky right column. This was done for two reasons: 1) to give the site a bit more depth and 2) to help me learn the basics of JavaScript. Now that both of these goals have been achieved, here is a guide detailing how it is done, which will hopefully prove useful to anyone new to this sort of thing.

Overview

Generating a random entity on a page can be split into three sections:
1) defining the entities you wish to choose between (i.e. text, images, banners etc)
2) defining a randomising function
3) using that function to return your desired entity
Each of these sections are dealt with in turn.




Tutorial pages:
 2 Votes

You might also want to check these out:


Leave a Comment on "How to Setup a Randomising Function"
You must be logged in to post a comment.

Link to This Tutorial Page!


GET OUR NEWSLETTERS