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

197
Views
How to properly get JSON after AJAX call?

I've spent a lot of time on this task and did hours of research but I still don't have a solution to this.

I get an 401 error

But if I add this at the end of the url: ?jsonpcallback=?

I get this in the console: Uncaught SyntaxError: Unexpected token :

Can someone guide me on this please and tell me what I'm doing wrong. Thank you in advance!

Here's my code:

  $.ajax({
        type: "GET",
        url: "XXX/jsonpcallback=?",
        dataType: 'jsonp',
        crossDomain:true,
        success: function (data){
            console.log(data);
        },
        error: function (err) {
            console.log(err)
        }
    });
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Try this.

$.getJSON('XXX/jsonpcallback=?xxx', function(data) {
     console.log(data);
});
about 4 years ago · Santiago Trujillo 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!