Pessoal estou com o seguinte problema é que estou usando jsf 2.0 e jboos AS 7.0.2 final em uma determinada tela tenho um contador temporizador em javascript ja testei e vi que quando uso a função (Math.floor)
tmp = Math.floor(segundos / times[i]); na function formatarTempo(segundos), e ja percebi que algumas funções em javascript também dão erro acho q deve ser alguma incompatibilidade do jboos com javascript, ou será que temos que configurar algo esse erro também dá no jboss 6.0.
esse erro dá na tela
javax.servlet.ServletException: Error Parsing /template.xhtml: Error Traced[line: 34] The content of elements must consist of well-formed character data or markup.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
esse é o javascript que uso
<script language="JavaScript">
contador = 3600;
function iniciar(){
div = document.getElementById('tempo');
div.innerHTML = formatarTempo(contador);
contador++;
id = setTimeout("iniciar()", 1000);
}
function parar(){
clearTimeout(id);
alert(formatarTempo(contador-1));
}
function formatarTempo(segundos){
var times = new Array(3600, 60, 1);
var time = '';
var tmp = 0;
for(var i = 0; i < times.length; i++){
tmp = Math.floor(segundos / times[i]);
if(tmp < 1){
tmp = '00';
}
else if(tmp < 10){
tmp = '0' + tmp;
}
time += tmp;
if(i < 2){
time += ':';
}
segundos = segundos % times[i];
}
return time;
}
</script>