jsFiddle is a dynamic example of a web-based javascript editing environment. It allows you to run and test small snippets of code, and the site itself is quite a unique engineering feat. See if you find it useful!
From the developers:
JsFiddle is a playground for web developers, a tool which may be used in many ways. One can use it as an online editor for snippets build from HTML, CSS and JavaScript. The code can then be shared with others, embedded on a blog, etc. Using this approach, JavaScript developers can very easily isolate bugs. We aim to support all actively developed frameworks - it helps with testing compatibility.