I have this code to work as character limiter for CKEditor, but its old and i dont know why does not work when i use Jquery librarie in the same web site
window.onload = function() {
CKEDITOR.instances.aqui.on( 'key', function() {
var str = CKEDITOR.instances.aqui.getData();
var regex = /(<([^>]+)>)/ig
, result = str.replace(regex, "");
if (result.length > 50) {
CKEDITOR.instances.aqui.setData(str);
}
} );
};
i want to update the code to use Jquery, but i dont know to much of jquery and i think if i use this function (replace, remove or text that) it will be more usefull
The code works if you dont add the Jquery library.