Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

123
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda