Lines Matching refs:xhr

167     options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
170 callbacks[i].apply(context, [data, status, xhr || $form, $form]);
260 s.xhr = function() {
261 var xhr = jQuery.ajaxSettings.xhr();
262 if (xhr.upload) {
263 xhr.upload.onprogress = function(event) {
273 return xhr;
279 s.beforeSend = function(xhr, o) {
282 beforeSend.call(this, xhr, o);
289 var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
330 xhr = { // mock object
350 xhr.error = e;
352 s.error.call(s.context, xhr, e, status);
354 $.event.trigger("ajaxError", [xhr, s, e]);
356 s.complete.call(s.context, xhr, e);
366 $.event.trigger("ajaxSend", [xhr, s]);
369 if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
376 if (xhr.aborted) {
508 if (xhr.aborted || callbackProcessed) {
518 if (e === CLIENT_TIMEOUT_ABORT && xhr) {
519 xhr.abort('timeout');
520 deferred.reject(xhr, 'timeout');
523 else if (e == SERVER_ABORT && xhr) {
524 xhr.abort('server abort');
525 deferred.reject(xhr, 'error', 'server abort');
562 xhr.responseText = docRoot ? docRoot.innerHTML : null;
563 xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
566 xhr.getResponseHeader = function(header){
572 xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
573 xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
582 xhr.responseText = ta.value;
584 xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
585 xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
592 xhr.responseText = pre.textContent ? pre.textContent : pre.innerText;
595 xhr.responseText = b.textContent ? b.textContent : b.innerText;
599 else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) {
600 xhr.responseXML = toXml(xhr.responseText);
604 data = httpData(xhr, dt, s);
608 xhr.error = errMsg = (e || status);
614 xhr.error = errMsg = (e || status);
617 if (xhr.aborted) {
622 if (xhr.status) { // we've set xhr.status
623 status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
629 s.success.call(s.context, data, 'success', xhr);
630 deferred.resolve(xhr.responseText, 'success', xhr);
632 $.event.trigger("ajaxSuccess", [xhr, s]);
636 errMsg = xhr.statusText;
638 s.error.call(s.context, xhr, status, errMsg);
639 deferred.reject(xhr, 'error', errMsg);
641 $.event.trigger("ajaxError", [xhr, s, errMsg]);
645 $.event.trigger("ajaxComplete", [xhr, s]);
652 s.complete.call(s.context, xhr, status);
662 xhr.responseXML = null;
682 var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
684 var ct = xhr.getResponseHeader('content-type') || '',
686 data = xml ? xhr.responseXML : xhr.responseText;