Skip to content

tssk/Javascript-PHP-Spell-Checker

 
 

Repository files navigation

Javascript/PHP Spell Checker

Word processor style spell check functionality for web applications.

Live Demo: http://www.lpology.com/code/spellcheck/

Overview

Javascript/PHP Spell Checker makes it easy to add an MS Word-style spell checker to any web application with almost no configuration. It's fast, lightweight, and works in all major browsers.

Features

  • Designed to mimic the appearance and feel of desktop word processor spell checkers.
  • Provides a list of suggestions for misspelled words.
  • Add spell check to any <textarea> or <div contenteditable="true">
  • Pure Javascript - requires no external libraries.
  • Fast and lightweight - less than 4KB, minified and gzipped.
  • Tested in IE7+, Firefox 4+, Safari 4+, and Chrome.

Requirements

  • PHP 5.3+ with Pspell extension installed

Getting Started

Copy spellcheck.php to your web directory. Include spellcheck.min.css and spellcheck.min.js into your page:

<head>
	<link rel="stylesheet" href="spellcheck.min.css">
	<script src="spellcheck.min.js"></script>
</head>

Initialize the spell checker when the DOM is ready. There are three required parameters:

var checker = new sc.SpellChecker({
	button: 'spellcheck_button', // HTML element that will open the spell checker when clicked
	textInput: 'text_box', // HTML field containing the text to spell check
	action: 'spellcheck.php' // URL of the server side script 
});
<textarea id="text_box"></textarea>
<input type="button" id="spellcheck_button" value="Check Spelling">

Installing Pspell

You'll need to install aspell, a dictionary, and the php-pspell module if not already installed:

sudo yum install aspell aspell-en
sudo yum install php-pspell

Then restart Apache:

sudo service httpd restart

License

Released under the MIT license.

githalytics.com alpha

About

Javascript plugin for adding a spell checker to web applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 79.2%
  • CSS 17.5%
  • PHP 3.3%