Have you thought about maybe writing a plugin in Javascript?
Also what are you trying to do specifically?
Writing a plugin in javascript would probably end up being more work than it's worth. I was trying to write a game of tic tac toe with AI, and it's just killing me slowly piecing the massive amounts of events and such needed to make it work out.