Questions tagged [jqxhr]

jqXHR is a jQuery object that provides a JavaScript cross-browser-compatible superset (wrapper) object for the browser-implemented XMLHttpRequest (XHR) object.

The jQuery XMLHttpRequest object (jqXHR in short) is returned by jQuery's $.ajax() method and as of jQuery 1.5, it is a superset of the browser's native XMLHttpRequest object. Among several properties and methods, it contains responseText, responseXML, and the getResponseHeader() method.

Example:

// send an AJAX request as usual
$.ajax('data.php'))    
  .done(function() {
    // the AJAX request was successful
    console.log('$.ajax succeeded');
  })      
  .fail(function() {
    // the AJAX request was unsuccessful
    console.log('$.ajax failed');
  })  
  .always(function() {
    // from jQuery 1.6, this function will always be called
    // either the AJAX request was successful or unsuccessful
    console.log('$.ajax either succeeded or failed');
  });

Resources

Related Tags

177 questions
0
votes
0 answers

Unable to load ajax requested pages

My apologies, first of all, if this comes across vague. I'm experiencing an issue that I can barely understand and thus find it hard to frame it as a clearly coherent question. Problem: When loading a page, content inside of a JQueryUI tabs fails. …
0
votes
1 answer

uploading file using pure javascript for dropbox and support for xhr on firefox 3.6

I am trying to make a pure javascript app capable of uploading certain files to dropbox. However I have hit upon a roadblock . Apparently on firefox 3.6 to be able to make a cross origin POST request . Firefox first sends the Access Control headers…
dusual
  • 2,097
  • 3
  • 19
  • 26
0
votes
0 answers

How can I create a Jquery XHR for images from an api and change images with an onclick function?

Good afternoon everyone. I'm attempting to display a set of images in a div, and use JQuery to fetch images from an API that changes the set of images when one of the header options are clicked. Any ideas? Trying to get a set of four 'set' images…
0
votes
0 answers

How to get ajax call return code when getting fullcalendar events

I have this fullcalendar definition: $('[data-toggle="calendar"]').fullCalendar({ themeSystem: 'bootstrap4', locale: 'es', monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril',…
jstuardo
  • 3,901
  • 14
  • 61
  • 136
0
votes
0 answers

How do I prevent the application layout from rendering twice when doing an XHR request?

I want to populate the landing page of my app with index pages of other controllers using xhr calls whenever someone loads the homepage. However, whenever I try doing this, the layout gets rendered twice I have tried a couple of things mentioned in…
0
votes
1 answer

ASP.NET Core - progressbar on form submit

I have a simple web page with form for uploading files. Everything works fine, but I need to use some overlay progressbar. I have problem with refreshing the progressbar itself. I was trying to use method posted in this question. But it does not…
David Bašta
  • 55
  • 1
  • 1
  • 7
0
votes
0 answers

statusTxt, jqXHR not working in Iframe jQuery

I am trying to get the responseTxt, statusTxt, jqXHR output but it is not working in the iframe instead it only working in the load function. I have seen the related threads but it was not helpful. I am trying after load iframe it will show an alert…
Satyam
  • 5
  • 4
0
votes
0 answers

JQXHR Object simply outputs to [object Object]

I have an API endpoint for registering a user written in Python Flask. I can see on the linux console that Flask is returning a 400 when the password does not have a lower case letter in it and it returns the json data…
puk
  • 16,318
  • 29
  • 119
  • 199
0
votes
0 answers

How do I get the content-length header for jQuery AJAX POST success object?

I have a jQuery AJAX call that appends a URL's page into a selector. I want to monitor the progress of the page being appended: $.ajax({ url: URL, type: 'POST', data: { page: 'page' }, dataType: 'HTML', …
A-Z
  • 11
  • 6
0
votes
1 answer

How to link ajax request failues to jqXHR status and error types?

Where can I find a full list of (common) things that go wrong with an $.ajax() request, and what error types/codes they result in? On https://api.jquery.com/jQuery.ajax/#jqXHR I can see all the possible outcomes, but not what can cause such an…
user1111929
  • 6,050
  • 9
  • 43
  • 73
0
votes
1 answer

receiving inflated response from body-parser in express app

Fully working example: I'm sending some binary data from front-end: fetch("http://localhost:8081/api", { "headers": { "accept": "*/*", "accept-language": "en-US,en;q=0.9,hr-HR;q=0.8,hr;q=0.7,es-US;q=0.6,es;q=0.5", "content-type":…
archara
  • 21
  • 5
0
votes
1 answer

Using flask, ajax - get response header value

I'm sending request through ajax, sending response through Flask. This is my code ajax ''' $.ajax({ url:'/get', type: "post", data: {"hi":"hello"}, success(function(data, textStatus, jqXHR){ …
0
votes
1 answer

jQuery.get is not pulling data from a valid URL

TLDR jQuery.get() correctly pulls the header information for one select option onchange value but not the others even though they are valid URLs. Goal To use jQuery and GitLab API to validate the header information of the select value when changed…
Mech
  • 3,952
  • 2
  • 14
  • 25
0
votes
0 answers

Same JQuery code, different statusText values on different machines

I can't figure this one out for the life of me... I have the following simple div block:
Loading...
and the following simple JQuery code: $.ajax({ cache: false, url: "/bogus-url", method: "GET", success:…
PillowMetal
  • 735
  • 1
  • 7
  • 14
0
votes
2 answers

How can cache XHR locally in a browser?

I was wondering how can cache a XHR locally on my computer and use it for next time. Well I visit a online shop regular in the order page there is a form which includes a field with XHR and I have to fill then and then complete my order with submit…
MSSHD
  • 11
  • 4