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
1 answer

Check for an invalid session to invoke login popup

I am working on a method to check for an invalid session variable in my asp.net project. Its a known fact that session variables tend to invalidate un-predictably in big projects. Though I tried almost everything but with no success. Now I am…
Cyberpks
  • 1,401
  • 6
  • 21
  • 51
0
votes
0 answers

How can I access HTTP request headers from Javascript?

I'm using Chrome for my development, but I don't think there's anything browser-specific in my question. I'm writing a Javascript app that needs to know the language the browser is using. According to this, I shouldn't use navigator.language; I…
dshapiro
  • 1,075
  • 14
  • 24
0
votes
1 answer

Is there any way to clear XHR cache data on client?

Using javascript or its libraries is there any way to clear cached XHR data on client? I want to test my app on few localhosts, wanted to clear XML HTTP Requests on client rather than on server, is there any way?
0
votes
1 answer

About jQuery XMLHttpRequest CORS GET request?

I've to append a custom Authentication header (among others) to all of my jQuery Ajax requests. I know that this can be accomplished using: beforeSend(jqXHR, settings) Function A pre-request callback function that can be used to modify the jqXHR …
gremo
  • 47,186
  • 75
  • 257
  • 421
0
votes
2 answers

How can we access to "server response" of "jqXHR" of ajaxSubmit function?

ajaxSubmit return form element. How can we access to "server response" of "jqXHR" of its ajax request?
Handsome Nerd
  • 17,114
  • 22
  • 95
  • 173
-1
votes
1 answer

Why is my $.ajax not showing up in Network tab, but opening in a new tab works?

Here is my AJAX code: jQuery.ajax({url: url, method: 'GET', data: getParams, /*success: function (json, textStatus, jqXHR) { if(jQuery.active <= 1){ waitDialog.removeWaitDialog(); } …
NobleUplift
  • 5,631
  • 8
  • 45
  • 87
-1
votes
2 answers

AJAX requests fails whitout error

My loadView function is a somehow broken function loadView(view){ $.get("../content/mainView.html", function(data) { $("#content-container").html(data); }) .done(function() { console.log("done"); }) .fail(function(xhr,…
rockZ
  • 815
  • 1
  • 12
  • 28
-1
votes
1 answer

jqXHR.statusText 'abort' vs 'canceled' when aborting the XHR

The jqXHR object used by jQuery.ajax has a property statusText, which can have two values when aborting the XHR: canceled and abort. When is the former used and when is the latter?
niutech
  • 28,923
  • 15
  • 96
  • 106
-1
votes
1 answer

Windows Store App xhr to localhost fails

I have a Win Store App app which uses REST to communicate with a pinpad device attached by USB. It has it's own proprietary http server/software but it seems fairly simple. In my dev machine and on my test machine all works as expected. However, on…
-1
votes
1 answer

kendo grid template js with remote datasource

I got a table with remote datasource. in one cell I got the userID. Because I want to show the username instead of the user ID I made a custom template function: function getUserName(pmcreator){ var user = ''; var data = '' …
da.eXecutoR
  • 313
  • 5
  • 16
-3
votes
1 answer

How do I write to console.log() from ajax calls two levels deep?

Please Note: I am new to using ajax and have no knowledge of error handling between different pages. I am calling an ajax call from within an ajax call; and would like to obtain a console.log() return from the 2nd page, which is two levels deep.…
MeSo2
  • 450
  • 1
  • 7
  • 18
-3
votes
1 answer

Handling API http return errors on JQuery

I have this html page: $(document).ready(function() { $.ajax({ url: "https://api.github.com/users/Microsoft/", type: 'GET', dataType: 'json', success: function(res) { $('#result').text(JSON.stringify(res, null,…
NeoVe
  • 3,857
  • 8
  • 54
  • 134
1 2 3
11
12