Ver Mensaje Individual
  #4 (permalink)  
Antiguo 08/12/2008, 11:05
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años
Puntos: 834
Respuesta: Unterminated string literal

Probá así:
Código PHP:
<?php
function js_encode($s){
    
$texto='';
    
$lon=strlen($s);
    for(
$i=0;$i<$lon;++$i){
        
$num=ord($s[$i]);
        if(
$num<16$texto.='\x0'.dechex($num);
        else 
$texto.='\x'.dechex($num);
    }
    return 
$texto;
}
$eventos_tipo_phpjs_encode(implode("a",$mapa_eventos_tipo));
?>
<script type="text/javascript">
    var evento_tipo= '<?php echo $eventos_tipo_php?>';
    alert(evento_tipo);
</script>