Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/12/2018, 17:41
stevens82
 
Fecha de Ingreso: octubre-2011
Mensajes: 132
Antigüedad: 12 años, 6 meses
Puntos: 4
script deja de funcionar con editor tinymce

Hola compañero aca con un problema, lo que pasa es que tengo un script de conteo de palabras, que funciona correctamente pero cuando uso el editor tinymce deja de funcionar, necesito saber como hacerlo funcionar, aca el codigo

Código Javascript:
Ver original
  1. counter = function() {
  2.     var value = $('#text').val();
  3.  
  4.     if (value.length == 0) {
  5.         $('#wordCount').html(0);
  6.         $('#totalChars').html(0);
  7.         $('#charCount').html(0);
  8.         $('#charCountNoSpace').html(0);
  9.         return;
  10.     }
  11.  
  12.     var regex = /\s+/gi;
  13.     var wordCount = value.trim().replace(regex, ' ').split(' ').length;
  14.     var totalChars = value.length;
  15.     var charCount = value.trim().length;
  16.     var charCountNoSpace = value.replace(regex, '').length;
  17.  
  18.     $('#wordCount').html(wordCount);
  19.     $('#totalChars').html(totalChars);
  20.     $('#charCount').html(charCount);
  21.     $('#charCountNoSpace').html(charCountNoSpace);
  22. };
  23.  
  24. $(document).ready(function() {
  25.     $('#count').click(counter);
  26.     $('#text').change(counter);
  27.     $('#text').keydown(counter);
  28.     $('#text').keypress(counter);
  29.     $('#text').keyup(counter);
  30.     $('#text').blur(counter);
  31.     $('#text').focus(counter);
  32. });

Editor Tinymce
Código Javascript:
Ver original
  1. tinymce.init({
  2.         selector: "#contenido"
  3.     });

espero alguien me pueda dar una mano, muchas gracias...