I've used Aspell via PHP and it works well.
So, what you can do is use Ajax to call the PHP script that checks the spelling.
Relatively speaking, grammar checking is a lot more difficult.
Here's one example which you can wrap in PHP and use similar to the spell checking.
I know the question was about JavaScript examples, but really, it'd be very difficult to have a pure JavaScript spell/grammar checking solution because of the amount of data to download.
One final thought: many browsers now have built-in spell checkers.