This page contains a prototype which shows how to translated user-generated JavaScript as safer scripts like Facebook does, since I really like this idea and it's really simple in terms of its design compare with other technics
After having played with some FBJS on Facebooks platform, I decided to make somthing similar like FBJS myself, a very simple parser written in PHP5 which convert your JS into FBJS-like codes.