14819Generating weighed random numbershttp://www.javascriptkit.com/javatutors/weighrandom.shtmlWhile it's impossible to forecast the exact occurrence of a random event, even a non-mathematician would agree we can manipulate the likelihood of something occurring. For example, in the case of winning the lottery, that would simply mean buying more tickets (and having your dreams dashed multiple times of course). In this tutorial, we take a stab at generating weighed random numbers, or random numbers with some more likely to show up than others. This is useful in situations where you need a more refined random engine, for example in a banner script that can display some banners more often than others.JavaScript > Tips and Tutorials > RandomizingOct 12, 2006JavaScript Kit
While it's impossible to forecast the exact occurrence of a random event, even a non-mathematician would agree we can manipulate the likelihood of something occurring. For example, in the case of winning the lottery, that would simply mean buying more tickets (and having your dreams dashed multiple times of course). In this tutorial, we take a stab at generating weighed random numbers, or random numbers with some more likely to show up than others. This is useful in situations where you need a more refined random engine, for example in a banner script that can display some banners more often than others.
Using external javascript files are great. You code them once. Check them then transplant them to any page by adding the SRC="./external file.js" to your tags. We use it extensively for the Date Stamp(Wednesday, December 20, 2006 ) on our pages. We know the code will not change and makes it easier putting it into multiple pages. Also, we will use it to change content on a page randomly or date based. Neat trick and gives your visitors fresh content. Another advantage is that your code will not be visible to folks that right click and view source on your pages.
Joining mailing list will entitle you
to receive occasional emails informing you of news and
updates to the site and any special offers that may be
of interest to you.