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

199
Vistas
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 Respuestas
Responde la pregunta

0

Try this.

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