Use 2: Ajax Spell Check

Ajax (Asynchronous JavaScript And XML), is a Web development technique for creating highly interactive web applications using JavaScript. Ajax Spell Check allows you to easily perform spell checking operations in JavaScript in the background as a web page runs.

With JavaScript SpellCheck all the work is done for you, you can use AJAX for spell checking using just a few lines of code.

Step 1.  Install javascript Spell Check

This only takes a few minutes, Find out how.

Step 2.  Include the JavaScript SpellCheck file in your web page

This code is normally included in head section of your web page.

<script src="/JavascriptSpellCheck/Include.js" type="text/javascript"></script>

Step 3. Set up an Ajax callBack function

<script>
var oSpell = new JavaScriptSpellCheck();
oSpell.ajaxCallBack=function(result)
{
    alert (result)
}
</script>

Step 4. Call the Ajax spellchecker

<script>
function spellCheck()
{
    oSpell.ajaxSpellCheck('test')
}
spellCheck()
</script>

Putting It All Together

<script src="/JavascriptSpellCheck/Include.js" type= "text/javascript"></script>

<input type="text" value= "Type Here" id="input1" name="input1" >
<input type="button" value= "SpellCheck" onClick="spellCheck()">

<script type= "text/javascript">
var oSpell = new JavaScriptSpellCheck();
oSpell.ajaxCallBack=function(result)
{
    if (result==true)
    {
        alert('spelling is OK')
    }
    else
    {
        var strAlert="Spelling Suggestion Array:\n"
        for ( i=0; i<result.length;i++)
        {
            strAlert+=(i+1)+") "+result[i]+"\n"
        }
        alert (strAlert)
    }
}
function spellCheck()
{
    oSpell.ajaxSpellCheck(document.getElementById('input1').value)
}
</script>

JavaScript AJAX Spell Check Example

If you need to set up the spellchecker such as language settings - please refer to the  Advanced Reference