Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

119
Vistas
VM3317:1 Uncaught SyntaxError: Unexpected token z in JSON at position 0

The title is the error I get. ATM I am upgrading the api to a higher version. Now i got this error. I have tried to fix it but no chance for me. Can someone help?

The code that gives the error is

appendCalls(callList = JSON.parse(xhr.responseText));

The whole function:

function getCallList() {
        var date = formatDate(currentDisplayDate);
        callCounter = 0;
        unansweredCalls = 0;
        
        $('#callCounter').html('');
        $('#spinner').addClass('display');
            
        xhr=new XMLHttpRequest();
        
        xhr.onreadystatechange=function() {
            console.log("sd1"); 
            if (xhr.readyState==4 && xhr.status==200) {
                console.log("sd2"); 
                appendCalls(callList = JSON.parse(xhr.responseText));
                console.log("sd3"); 
            }
        }
    
        xhr.open("GET","/api.php?f=calllist&date="+date,true);
        xhr.send();
        
    }

"appendCalls" is another function. If you need it I can post it.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Yeah I checked the output (idk why I don't thought about that) and saw I had an console output that was starting with an 'z'. It works now so Thanks!

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda