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

142
Views
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
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!