I implemented a word cloud using javascript only recently. I initially got the inspiration and a lot of the code especially for the frequency and tags from an article Aleks Bochniak wrote back in 2008. His blog can be found here: http://aleks.bochniak.net/postbox/mysource-matrix/how-to-make-a-tag-cloud .

The code is a big much to throw up on here but if you're interested just take a look at johnverber.com/wordcloud.html. (http://johnverber.com/wordcloud.html)