I think you need to rethink your question. The Poisson is a counting distribution specified in terms of a rate, such as how many occurrences of something do I see on average per time period. It yields positive integers so the result can't be just in the range [0,1]. Can you please clarify what you want?
Regardless, to generate a Poisson with rate lambda one algorithm is:
threshold = Math.exp(-lambda)
count = 0
product = 1.0
while (product *= rand) >= threshold {
count += 1
}
return count
where "rand" is the function call for a Uniform(0,1). I don't know javascript, but that should be straightforward enough for you to implement.
Responding to edited question:
There are several distributions that generate outcomes on a bounded range, but many of them aren't for the faint of heart, such as the Johnson family or the Beta distribution.
An easy one would be triangle distributions. Sqrt(rand) will give a triangle distribution bunched towards 1, while (1-Sqrt(1-rand)) will give a triangle distribution bunched towards zero.
A more general triangle with the mode (most frequent value) at m (where 0 <= m <= 1) can be generated with
if rand <= m
return m * Sqrt(rand)
else
return 1 - ((1 - m) * Sqrt(1 - rand))
Note that each invocation of rand is a separate Uniform random number, this won't be correct if you generate one value for rand and use it throughout.