Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

116
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!