Ver Mensaje Individual
  #3 (permalink)  
Antiguo 14/12/2013, 13:32
Avatar de Zume
Zume
 
Fecha de Ingreso: diciembre-2013
Mensajes: 10
Antigüedad: 10 años, 5 meses
Puntos: 0
Respuesta: Como hago esto? (array's)

Cita:
Iniciado por Lynxcraft Ver Mensaje
si utilizas nombre de funciones encierralas ente comillas simples

Código Javascript:
Ver original
  1. <script>
  2. var BuscarExpresion = ['new', 'for', 'switch', 'case', 'sizeof', 'public', 'return',
  3.               'if', 'else', 'while', 'true', 'false', 'double', 'try', 'void'];
  4. for(var n in BuscarExpresion )
  5. Texto = Texto.RemplazarArray(new RegExp("/\b"+BuscarExpresion[n]+"\b/","g"), ColorearExp);
  6. </script>
Muchas gracias solo hay un problema xD no lo colorea, lo puse así:

Código Javascript:
Ver original
  1. var BuscarExpresion = ['new', 'for', 'switch', 'case', 'sizeof', 'public', 'return',
  2.                        'if', 'else', 'while', 'true', 'false', 'double', 'try', 'void',
  3.                'char', 'enum', 'static', 'using', 'namespace', 'unsigned', 'const', 'struct', 'break', 'continue'];
  4.  
  5. for(var n in BuscarExpresion );
  6. Texto = Texto.RemplazarArray(new RegExp("/\b"+BuscarExpresion[n]+"\b/","g"), "<span class='AZUL'>"+BuscarExpresion[n]+"</span>");