Mozilla and the ajax.com guys have put a significant amount of effort into this area (the current system is the third rewrite for the Mozilla guys) and both teams had a pretty good set of js hackers. I disagree with some of the decisions made (mostly due to scope and what I think is important vs what they think and my background in writing several Vim plugins) but the decisions weren't made from technical ignorance or not being willing to experiment with non-DOM backends. If you aren't familiar with what they're doing, you're going to spend most of your time rediscovering pain points. The simplest example I know of is that there isn't a good way to figure out exactly what the user typed other than having them type into a hidden text field and reading the results back. The obvious approaches seem to work for US/EU keyboards but fall apart on the CJK family.