Coded - Web Development and Programming Blog

C#, ASP.NET, Google, Remoting, AJAX, Silverlight, Web Development

How does SharpSpell work?

Posted in SharpSpell by Andrei Alecu on the August 23rd, 2007

Many people are wondering how SharpSpell is able to provide wavy underline spell checking for regular HTML TEXTAREA elements. Other competitors replace TEXTAREAs with editable IFRAMEs to provide the same functionality, but this is an invasive method that we strongly discourage.

The trick is to try to replicate the content of the TextArea as best as possible using a DIV that is positioned directly underneath the textbox. The TextArea’s background is then set to transparent, and the DIV shows up through it.

We then send the text in the TEXTAREA to the server using AJAX calls, retrieve misspellings and suggestions, and we then recreate the DIV on the client using CSS to display the underlines.

Technorati Tags: , , ,

Bookmark on del.icio.us

Leave a Reply