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

143
Vistas
JSONP get status reponse

I use an ajax request to fetch data from an api. Due to CORS issues, I have to request JSONP as dataType. Now I want to provide some information about validation errors to the users, which comes from the endpoint.

$.ajax({
        url: patBaseUrl,
        type: "GET",
        crossDomain: true,
        data: { apikey:  patBaseToken, query: query},
        dataType : 'jsonp',
        contentType: "application/javascript",
        xhrFields: {
          withCredentials: true
      },
        success: function(response) {
            addAlert('success', '<b>Success!</b> Query was sent successfully!');
        },
        error: function(xhr) {
            addAlert('warning', '<b>Warning!</b> Something went wrong: ' + xhr.status + ' ' + xhr.statusText);
            console.log(xhr.status, xhr.statusText);
        }

In the console I get for e.g. GET.... 404 Missing-Query How do I get the text Missing-Query?

about 4 years ago · Juan Pablo Isaza
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