You don't need ajax to do this. Just use a script on the page for far less overhead, for example:
HTML:
<!-- create textarea and limit characters -->
<textarea id="input" rows="4" cols="50" maxlength="500">
</textarea>
<span id="output"></span>
JS:
var maxWords = 500;
var input = document.getElementById('input');
var output = document.getElementById('output');
output.innerHTML = maxWords + " words left";
input.onkeyup = function() {
var words = input.value.split(" "); // Convert string into words
var diff = maxWords - words.length; // Subtract words from maxWords
if (diff < 0) { // If words < maxWords prevent user from inputting more than maxWords
words.length = maxWords; // Remove words over limit
input.value = words.join(" "); // Fill input
diff = 0;
}
output.innerHTML = diff + " words left"; // Tell user new word count
}
http://jsfiddle.net/georeith/z2KfV/2/
This doesn't take into account the complexities of language however and assumes that any space denotes a new word. If you want it to do those things you will have to look into using regex.
For a max character version see: http://jsfiddle.net/georeith/z2KfV/4/