WebSpellChecker (WSC)

WSC operates in a separate browser window so your work is not obstructed. Corrected text is automatically returned to the form.

WebSpellChecker (WSC) for Textarea (Extra functionality)

Spell Check

Installation Guide

1. Specify WSC URI (See sample, line 6);

2. Define the WSC invoker:

doSpell({ctrl:sMyEditor, lang:sInitialLanguage, onClose:onCloseHandler, onCancel:onCancelHandler, onFinish:onFinishHandler}), where:
  • sMyEditor {String,mandatory} — textarea instance identifier.
  • sInitialLanguage {String, mandatory} — initial spell check language name. Now supported: en_US, en_GB, pt_BR, en_CA, fr_CA, fr_FR, de_DE, it_IT, el_GR, es_ES, da_DK, nl_NL, nb_NO, pt_PT, sv_SE, fi_FI.
  • onCloseHandler {Function,optional} — Callback function reference.
  • onCancelHandler {Function,optional} — Callback function reference.
  • onFinishHandler {Function,optional} — Callback function reference.

See sample, lines 8-16.

3. To execute a custom code after finishing, cancelling the spell check or closing the WSC window, define the callback functions:

onCloseHandler = function (mSender){}.
onCancelHandler = function (mSender){}.
onFinishHandler = function (mSender){}, where:

mSender {Mixed,optional} — Checked Element or Array of Elements (depending on contents).

(see sample, lines 12-14), and register them (see sample, line 18-20).

4. Invoke WSC when you want to check the spelling (see sample, line 28).

Sample

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
		//For Licensed version only
		<script type="text/javascript" src="[port]://[your_hostname]/spellcheck/script/ssrv.cgi?cmd=script&doc=wsc"></script>
		//For Hosted version only
		<script type="text/javascript" src="http://svc.webspellchecker.net/spellcheck/script/ssrv.cgi?cmd=script&doc=wsc&customerid=[your_long_customer_ID]"> </script>
        <script type="text/javascript">
            function startSpellCheck(){
                doSpell({
                    ctrl:'myEditor',
                    lang:'en_US',
		    		userDictionaryName: sUserDictionaryName,
                    customDictionaryName: 1,3001,
					onClose:onClose,
					onCancel:onCancel,
					onFinish:onFinish
                });
            }
			// specify callback functions:
			onClose = function(mSender){alert("Spell checking was aborted");}
			onCancel = function(mSender){alert("Spell checking was canceled");}
			onFinish = function(mSender){alert("Spell checking was finished");}

        </script>
    </head>
    <body>
        <textarea id="myEditor" name="myEditor" >
            This is an exampl of a sentence with two mispelled words.
        <⁄textarea>
        <input  type="button" value="Spell Check" onclick="startSpellCheck();" />
    </body>
</html>