Scripts: Javascript :: Spell checkers :: Library Article #24
Developer's Section
Pure Javascript Spell Checker By: Erobo Software
|
Hire a Developer for Related Work / Installation | $55 hr
|
|
Rating: | Rate It:
|
Average Votes: (3803)
|
Favorites:
|
|
|
|
The Pure Javascript Spell Checker finds and helps you correct any spelling errors in you input forms. It supports HTML, multiple languages, and grammar checks.
This Javascript based spell checker is capable of finding errors in your input fields with the ease of a few clicks. It supports embedded HTML tags ( as on WYSIWYG text editors) and can be configured to work on multiple languages. Finally, it provides a grammar check option that allows you to find punctuation and capitalization errors in the same text.
Example 1: With Grammar Check Option Enabled:
Spell Check Now
Example 2: With Grammar Check Option Disabled:
Spell Check Now
Now, let's take a look at the code:
| Code Snippet 1 |
|
|
<!-- Step1: include Pure Spell Checker JS-->
<script language="JavaScript" SRC="yourSitePath/pureSpellCheck.js">
</script>
<!-- Step2: include empty iframe ( only declare it once) -->
<!-- Iframe will only be loaded when user clicks on Spell Check-->
<iframe id="cylinder" style="display:none"></iframe>
<!-- Step3: declare text area or WYSIWYG editor-->
<textarea name="mytextfield" id="mytextfield" rows="8" cols="40">
</textarea>
<br>
<script language="javascript">
//Step 4: create a new Pure Spell Checker Object
// parameter 1: text area id assigned
// parameter 2: your language of preference e.g.
// English, Spanish, Italian, French, Dutch, Portuguese, Deutsch
// parameter 3: your path to spell checker images. e.g '/spellCheckImgs/'
// parameter 4: your path to dictionary words files. e.g '/spellCheckWrds/'
//
// Note: you can leave the last 2 parameters empty if the images
// and dictionary word files are on the same directory as
// the file you are calling the Pure Spell Check Object
var SpellCheckerObj = new PureSpellChecker('mytextfield','english','','');
//Step 5: Configure additional parameters
SpellCheckerObj.webmasterEmail = "username@yoursite.com";
SpellCheckerObj.checkGrammar = true;
//Note: If you set the grammar check option to false,
// the spell checker will not look for punctuation
// and capitalization errors in the input text.
//-> Uncomment the line below to preload dictionary of words
//SpellCheckerObj.preloadDictionary();
//Note: If you choose to preload the dictionary of words the spell checker
// will load faster but the initial load time of the webpage may be slower.
// Also, calling this at the end of webpage may reduce loading overhead.
</script>
<!-- Step 6:-->
<!-- Include link to start loading the words & the Pure Spell Check App -->
<a href="javascript:SpellCheckerObj.display(true);" id="mytest">
Spell Check Now</a>
<!-- Step 7:-->
<!-- place the images progress_bar_sp.gif, progress_bar_wrd.gif
and invisible.gif in a folder and make sure parameter 3
of the Spell Checker specifies the right path to that folder.
-->
<!-- Step 8:-->
<!-- place the file english_cylinder.htm or your language
of preference file in a folder and make sure parameter 4
of the Spell Checker specifies the right path to that folder.
-->
|
The end. Good Luck!
|
|
See other Scripts in Spell checkers |
Submit Your Scripts: |
System Message:
- Your Javascript script has been sent. Please allow 48 hours for processing.
|
If you would like to have your Javascripts published in this section please fill out the form below: |