Browser Based Spell Checking Plugin For jQuery - Spellchecker

File Size: 6.11 MB
Views Total: 10872
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Browser Based Spell Checking Plugin For jQuery - Spellchecker

Spellchecker is a jQuery plugin that allows you to spellcheck spelling mistakes whthin a form field or a DOM tree,  and then the word is checked against a list of already correct words. The plugin support Unicode so that it can work with most major languages. Spellchecker comes with HTML parsing and Text parsing for using it whthin WSYIWYG editors and form fields.

Basic Usage (Using a webservice to check spelling):

1. Include jQuery Library and Spellchecker.js

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="jquery.spellchecker.js"></script>

2. Include Spellchecker to style your plugin

<link rel="stylesheet" type="text/css" media="screen" href="jquery.spellchecker.css" />

3. Create a text area and a check button

<div id="text-content">
      Here is a badw<strong>o<em>rd</em></strong>d. It has beeen incorrectly spelt.
</div>
<button id="check-textarea">
      Check Spelling
</button>

4. Call the plugin

<script type="text/javascript">
(function() {

// Init the html spellchecker
var spellchecker = new $.SpellChecker('#text-content', {
lang: 'en',
parser: 'html',
webservice: {
path: '../../webservices/php/SpellChecker.php', 
driver: 'PSpell'
},
suggestBox: {
position: 'below'
}
});

// Bind spellchecker handler functions
spellchecker.on('check.success', function() {
alert('There are no incorrectly spelt words!');
});

// Check the spelling
$("#check-textarea").click(function(e){
spellchecker.check();
});

})();
</script>

This awesome jQuery plugin is developed by badsyntax. For more Advanced Usages, please check the demo page or visit the official website.