Edit File by line
/home/barbar84/public_h.../wp-inclu.../js/jquery
File: jquery.form.js
/*!
[0] Fix | Delete
* jQuery Form Plugin
[1] Fix | Delete
* version: 4.2.1
[2] Fix | Delete
* Requires jQuery v1.7 or later
[3] Fix | Delete
* Copyright 2017 Kevin Morris
[4] Fix | Delete
* Copyright 2006 M. Alsup
[5] Fix | Delete
* Project repository: https://github.com/jquery-form/form
[6] Fix | Delete
* Dual licensed under the MIT and LGPLv3 licenses.
[7] Fix | Delete
* https://github.com/jquery-form/form#license
[8] Fix | Delete
*/
[9] Fix | Delete
/* global ActiveXObject */
[10] Fix | Delete
[11] Fix | Delete
/* eslint-disable */
[12] Fix | Delete
(function (factory) {
[13] Fix | Delete
if (typeof define === 'function' && define.amd) {
[14] Fix | Delete
// AMD. Register as an anonymous module.
[15] Fix | Delete
define(['jquery'], factory);
[16] Fix | Delete
} else if (typeof module === 'object' && module.exports) {
[17] Fix | Delete
// Node/CommonJS
[18] Fix | Delete
module.exports = function( root, jQuery ) {
[19] Fix | Delete
if (typeof jQuery === 'undefined') {
[20] Fix | Delete
// require('jQuery') returns a factory that requires window to build a jQuery instance, we normalize how we use modules
[21] Fix | Delete
// that require this pattern but the window provided is a noop if it's defined (how jquery works)
[22] Fix | Delete
if (typeof window !== 'undefined') {
[23] Fix | Delete
jQuery = require('jquery');
[24] Fix | Delete
}
[25] Fix | Delete
else {
[26] Fix | Delete
jQuery = require('jquery')(root);
[27] Fix | Delete
}
[28] Fix | Delete
}
[29] Fix | Delete
factory(jQuery);
[30] Fix | Delete
return jQuery;
[31] Fix | Delete
};
[32] Fix | Delete
} else {
[33] Fix | Delete
// Browser globals
[34] Fix | Delete
factory(jQuery);
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
}(function ($) {
[38] Fix | Delete
/* eslint-enable */
[39] Fix | Delete
'use strict';
[40] Fix | Delete
[41] Fix | Delete
/*
[42] Fix | Delete
Usage Note:
[43] Fix | Delete
-----------
[44] Fix | Delete
Do not use both ajaxSubmit and ajaxForm on the same form. These
[45] Fix | Delete
functions are mutually exclusive. Use ajaxSubmit if you want
[46] Fix | Delete
to bind your own submit handler to the form. For example,
[47] Fix | Delete
[48] Fix | Delete
$(document).ready(function() {
[49] Fix | Delete
$('#myForm').on('submit', function(e) {
[50] Fix | Delete
e.preventDefault(); // <-- important
[51] Fix | Delete
$(this).ajaxSubmit({
[52] Fix | Delete
target: '#output'
[53] Fix | Delete
});
[54] Fix | Delete
});
[55] Fix | Delete
});
[56] Fix | Delete
[57] Fix | Delete
Use ajaxForm when you want the plugin to manage all the event binding
[58] Fix | Delete
for you. For example,
[59] Fix | Delete
[60] Fix | Delete
$(document).ready(function() {
[61] Fix | Delete
$('#myForm').ajaxForm({
[62] Fix | Delete
target: '#output'
[63] Fix | Delete
});
[64] Fix | Delete
});
[65] Fix | Delete
[66] Fix | Delete
You can also use ajaxForm with delegation (requires jQuery v1.7+), so the
[67] Fix | Delete
form does not have to exist when you invoke ajaxForm:
[68] Fix | Delete
[69] Fix | Delete
$('#myForm').ajaxForm({
[70] Fix | Delete
delegation: true,
[71] Fix | Delete
target: '#output'
[72] Fix | Delete
});
[73] Fix | Delete
[74] Fix | Delete
When using ajaxForm, the ajaxSubmit function will be invoked for you
[75] Fix | Delete
at the appropriate time.
[76] Fix | Delete
*/
[77] Fix | Delete
[78] Fix | Delete
var rCRLF = /\r?\n/g;
[79] Fix | Delete
[80] Fix | Delete
/**
[81] Fix | Delete
* Feature detection
[82] Fix | Delete
*/
[83] Fix | Delete
var feature = {};
[84] Fix | Delete
[85] Fix | Delete
feature.fileapi = $('<input type="file">').get(0).files !== undefined;
[86] Fix | Delete
feature.formdata = (typeof window.FormData !== 'undefined');
[87] Fix | Delete
[88] Fix | Delete
var hasProp = !!$.fn.prop;
[89] Fix | Delete
[90] Fix | Delete
// attr2 uses prop when it can but checks the return type for
[91] Fix | Delete
// an expected string. This accounts for the case where a form
[92] Fix | Delete
// contains inputs with names like "action" or "method"; in those
[93] Fix | Delete
// cases "prop" returns the element
[94] Fix | Delete
$.fn.attr2 = function() {
[95] Fix | Delete
if (!hasProp) {
[96] Fix | Delete
return this.attr.apply(this, arguments);
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
var val = this.prop.apply(this, arguments);
[100] Fix | Delete
[101] Fix | Delete
if ((val && val.jquery) || typeof val === 'string') {
[102] Fix | Delete
return val;
[103] Fix | Delete
}
[104] Fix | Delete
[105] Fix | Delete
return this.attr.apply(this, arguments);
[106] Fix | Delete
};
[107] Fix | Delete
[108] Fix | Delete
/**
[109] Fix | Delete
* ajaxSubmit() provides a mechanism for immediately submitting
[110] Fix | Delete
* an HTML form using AJAX.
[111] Fix | Delete
*
[112] Fix | Delete
* @param {object|string} options jquery.form.js parameters or custom url for submission
[113] Fix | Delete
* @param {object} data extraData
[114] Fix | Delete
* @param {string} dataType ajax dataType
[115] Fix | Delete
* @param {function} onSuccess ajax success callback function
[116] Fix | Delete
*/
[117] Fix | Delete
$.fn.ajaxSubmit = function(options, data, dataType, onSuccess) {
[118] Fix | Delete
// fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
[119] Fix | Delete
if (!this.length) {
[120] Fix | Delete
log('ajaxSubmit: skipping submit process - no element selected');
[121] Fix | Delete
[122] Fix | Delete
return this;
[123] Fix | Delete
}
[124] Fix | Delete
[125] Fix | Delete
/* eslint consistent-this: ["error", "$form"] */
[126] Fix | Delete
var method, action, url, $form = this;
[127] Fix | Delete
[128] Fix | Delete
if (typeof options === 'function') {
[129] Fix | Delete
options = {success: options};
[130] Fix | Delete
[131] Fix | Delete
} else if (typeof options === 'string' || (options === false && arguments.length > 0)) {
[132] Fix | Delete
options = {
[133] Fix | Delete
'url' : options,
[134] Fix | Delete
'data' : data,
[135] Fix | Delete
'dataType' : dataType
[136] Fix | Delete
};
[137] Fix | Delete
[138] Fix | Delete
if (typeof onSuccess === 'function') {
[139] Fix | Delete
options.success = onSuccess;
[140] Fix | Delete
}
[141] Fix | Delete
[142] Fix | Delete
} else if (typeof options === 'undefined') {
[143] Fix | Delete
options = {};
[144] Fix | Delete
}
[145] Fix | Delete
[146] Fix | Delete
method = options.method || options.type || this.attr2('method');
[147] Fix | Delete
action = options.url || this.attr2('action');
[148] Fix | Delete
[149] Fix | Delete
url = (typeof action === 'string') ? $.trim(action) : '';
[150] Fix | Delete
url = url || window.location.href || '';
[151] Fix | Delete
if (url) {
[152] Fix | Delete
// clean url (don't include hash vaue)
[153] Fix | Delete
url = (url.match(/^([^#]+)/) || [])[1];
[154] Fix | Delete
}
[155] Fix | Delete
[156] Fix | Delete
options = $.extend(true, {
[157] Fix | Delete
url : url,
[158] Fix | Delete
success : $.ajaxSettings.success,
[159] Fix | Delete
type : method || $.ajaxSettings.type,
[160] Fix | Delete
iframeSrc : /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' // eslint-disable-line no-script-url
[161] Fix | Delete
}, options);
[162] Fix | Delete
[163] Fix | Delete
// hook for manipulating the form data before it is extracted;
[164] Fix | Delete
// convenient for use with rich editors like tinyMCE or FCKEditor
[165] Fix | Delete
var veto = {};
[166] Fix | Delete
[167] Fix | Delete
this.trigger('form-pre-serialize', [this, options, veto]);
[168] Fix | Delete
[169] Fix | Delete
if (veto.veto) {
[170] Fix | Delete
log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
[171] Fix | Delete
[172] Fix | Delete
return this;
[173] Fix | Delete
}
[174] Fix | Delete
[175] Fix | Delete
// provide opportunity to alter form data before it is serialized
[176] Fix | Delete
if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
[177] Fix | Delete
log('ajaxSubmit: submit aborted via beforeSerialize callback');
[178] Fix | Delete
[179] Fix | Delete
return this;
[180] Fix | Delete
}
[181] Fix | Delete
[182] Fix | Delete
var traditional = options.traditional;
[183] Fix | Delete
[184] Fix | Delete
if (typeof traditional === 'undefined') {
[185] Fix | Delete
traditional = $.ajaxSettings.traditional;
[186] Fix | Delete
}
[187] Fix | Delete
[188] Fix | Delete
var elements = [];
[189] Fix | Delete
var qx, a = this.formToArray(options.semantic, elements, options.filtering);
[190] Fix | Delete
[191] Fix | Delete
if (options.data) {
[192] Fix | Delete
var optionsData = $.isFunction(options.data) ? options.data(a) : options.data;
[193] Fix | Delete
[194] Fix | Delete
options.extraData = optionsData;
[195] Fix | Delete
qx = $.param(optionsData, traditional);
[196] Fix | Delete
}
[197] Fix | Delete
[198] Fix | Delete
// give pre-submit callback an opportunity to abort the submit
[199] Fix | Delete
if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
[200] Fix | Delete
log('ajaxSubmit: submit aborted via beforeSubmit callback');
[201] Fix | Delete
[202] Fix | Delete
return this;
[203] Fix | Delete
}
[204] Fix | Delete
[205] Fix | Delete
// fire vetoable 'validate' event
[206] Fix | Delete
this.trigger('form-submit-validate', [a, this, options, veto]);
[207] Fix | Delete
if (veto.veto) {
[208] Fix | Delete
log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
[209] Fix | Delete
[210] Fix | Delete
return this;
[211] Fix | Delete
}
[212] Fix | Delete
[213] Fix | Delete
var q = $.param(a, traditional);
[214] Fix | Delete
[215] Fix | Delete
if (qx) {
[216] Fix | Delete
q = (q ? (q + '&' + qx) : qx);
[217] Fix | Delete
}
[218] Fix | Delete
[219] Fix | Delete
if (options.type.toUpperCase() === 'GET') {
[220] Fix | Delete
options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
[221] Fix | Delete
options.data = null; // data is null for 'get'
[222] Fix | Delete
} else {
[223] Fix | Delete
options.data = q; // data is the query string for 'post'
[224] Fix | Delete
}
[225] Fix | Delete
[226] Fix | Delete
var callbacks = [];
[227] Fix | Delete
[228] Fix | Delete
if (options.resetForm) {
[229] Fix | Delete
callbacks.push(function() {
[230] Fix | Delete
$form.resetForm();
[231] Fix | Delete
});
[232] Fix | Delete
}
[233] Fix | Delete
[234] Fix | Delete
if (options.clearForm) {
[235] Fix | Delete
callbacks.push(function() {
[236] Fix | Delete
$form.clearForm(options.includeHidden);
[237] Fix | Delete
});
[238] Fix | Delete
}
[239] Fix | Delete
[240] Fix | Delete
// perform a load on the target only if dataType is not provided
[241] Fix | Delete
if (!options.dataType && options.target) {
[242] Fix | Delete
var oldSuccess = options.success || function(){};
[243] Fix | Delete
[244] Fix | Delete
callbacks.push(function(data, textStatus, jqXHR) {
[245] Fix | Delete
var successArguments = arguments,
[246] Fix | Delete
fn = options.replaceTarget ? 'replaceWith' : 'html';
[247] Fix | Delete
[248] Fix | Delete
$(options.target)[fn](data).each(function(){
[249] Fix | Delete
oldSuccess.apply(this, successArguments);
[250] Fix | Delete
});
[251] Fix | Delete
});
[252] Fix | Delete
[253] Fix | Delete
} else if (options.success) {
[254] Fix | Delete
if ($.isArray(options.success)) {
[255] Fix | Delete
$.merge(callbacks, options.success);
[256] Fix | Delete
} else {
[257] Fix | Delete
callbacks.push(options.success);
[258] Fix | Delete
}
[259] Fix | Delete
}
[260] Fix | Delete
[261] Fix | Delete
options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
[262] Fix | Delete
var context = options.context || this; // jQuery 1.4+ supports scope context
[263] Fix | Delete
[264] Fix | Delete
for (var i = 0, max = callbacks.length; i < max; i++) {
[265] Fix | Delete
callbacks[i].apply(context, [data, status, xhr || $form, $form]);
[266] Fix | Delete
}
[267] Fix | Delete
};
[268] Fix | Delete
[269] Fix | Delete
if (options.error) {
[270] Fix | Delete
var oldError = options.error;
[271] Fix | Delete
[272] Fix | Delete
options.error = function(xhr, status, error) {
[273] Fix | Delete
var context = options.context || this;
[274] Fix | Delete
[275] Fix | Delete
oldError.apply(context, [xhr, status, error, $form]);
[276] Fix | Delete
};
[277] Fix | Delete
}
[278] Fix | Delete
[279] Fix | Delete
if (options.complete) {
[280] Fix | Delete
var oldComplete = options.complete;
[281] Fix | Delete
[282] Fix | Delete
options.complete = function(xhr, status) {
[283] Fix | Delete
var context = options.context || this;
[284] Fix | Delete
[285] Fix | Delete
oldComplete.apply(context, [xhr, status, $form]);
[286] Fix | Delete
};
[287] Fix | Delete
}
[288] Fix | Delete
[289] Fix | Delete
// are there files to upload?
[290] Fix | Delete
[291] Fix | Delete
// [value] (issue #113), also see comment:
[292] Fix | Delete
// https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219
[293] Fix | Delete
var fileInputs = $('input[type=file]:enabled', this).filter(function() {
[294] Fix | Delete
return $(this).val() !== '';
[295] Fix | Delete
});
[296] Fix | Delete
var hasFileInputs = fileInputs.length > 0;
[297] Fix | Delete
var mp = 'multipart/form-data';
[298] Fix | Delete
var multipart = ($form.attr('enctype') === mp || $form.attr('encoding') === mp);
[299] Fix | Delete
var fileAPI = feature.fileapi && feature.formdata;
[300] Fix | Delete
[301] Fix | Delete
log('fileAPI :' + fileAPI);
[302] Fix | Delete
[303] Fix | Delete
var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;
[304] Fix | Delete
var jqxhr;
[305] Fix | Delete
[306] Fix | Delete
// options.iframe allows user to force iframe mode
[307] Fix | Delete
// 06-NOV-09: now defaulting to iframe mode if file input is detected
[308] Fix | Delete
if (options.iframe !== false && (options.iframe || shouldUseFrame)) {
[309] Fix | Delete
// hack to fix Safari hang (thanks to Tim Molendijk for this)
[310] Fix | Delete
// see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
[311] Fix | Delete
if (options.closeKeepAlive) {
[312] Fix | Delete
$.get(options.closeKeepAlive, function() {
[313] Fix | Delete
jqxhr = fileUploadIframe(a);
[314] Fix | Delete
});
[315] Fix | Delete
[316] Fix | Delete
} else {
[317] Fix | Delete
jqxhr = fileUploadIframe(a);
[318] Fix | Delete
}
[319] Fix | Delete
[320] Fix | Delete
} else if ((hasFileInputs || multipart) && fileAPI) {
[321] Fix | Delete
jqxhr = fileUploadXhr(a);
[322] Fix | Delete
[323] Fix | Delete
} else {
[324] Fix | Delete
jqxhr = $.ajax(options);
[325] Fix | Delete
}
[326] Fix | Delete
[327] Fix | Delete
$form.removeData('jqxhr').data('jqxhr', jqxhr);
[328] Fix | Delete
[329] Fix | Delete
// clear element array
[330] Fix | Delete
for (var k = 0; k < elements.length; k++) {
[331] Fix | Delete
elements[k] = null;
[332] Fix | Delete
}
[333] Fix | Delete
[334] Fix | Delete
// fire 'notify' event
[335] Fix | Delete
this.trigger('form-submit-notify', [this, options]);
[336] Fix | Delete
[337] Fix | Delete
return this;
[338] Fix | Delete
[339] Fix | Delete
// utility fn for deep serialization
[340] Fix | Delete
function deepSerialize(extraData) {
[341] Fix | Delete
var serialized = $.param(extraData, options.traditional).split('&');
[342] Fix | Delete
var len = serialized.length;
[343] Fix | Delete
var result = [];
[344] Fix | Delete
var i, part;
[345] Fix | Delete
[346] Fix | Delete
for (i = 0; i < len; i++) {
[347] Fix | Delete
// #252; undo param space replacement
[348] Fix | Delete
serialized[i] = serialized[i].replace(/\+/g, ' ');
[349] Fix | Delete
part = serialized[i].split('=');
[350] Fix | Delete
// #278; use array instead of object storage, favoring array serializations
[351] Fix | Delete
result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]);
[352] Fix | Delete
}
[353] Fix | Delete
[354] Fix | Delete
return result;
[355] Fix | Delete
}
[356] Fix | Delete
[357] Fix | Delete
// XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz)
[358] Fix | Delete
function fileUploadXhr(a) {
[359] Fix | Delete
var formdata = new FormData();
[360] Fix | Delete
[361] Fix | Delete
for (var i = 0; i < a.length; i++) {
[362] Fix | Delete
formdata.append(a[i].name, a[i].value);
[363] Fix | Delete
}
[364] Fix | Delete
[365] Fix | Delete
if (options.extraData) {
[366] Fix | Delete
var serializedData = deepSerialize(options.extraData);
[367] Fix | Delete
[368] Fix | Delete
for (i = 0; i < serializedData.length; i++) {
[369] Fix | Delete
if (serializedData[i]) {
[370] Fix | Delete
formdata.append(serializedData[i][0], serializedData[i][1]);
[371] Fix | Delete
}
[372] Fix | Delete
}
[373] Fix | Delete
}
[374] Fix | Delete
[375] Fix | Delete
options.data = null;
[376] Fix | Delete
[377] Fix | Delete
var s = $.extend(true, {}, $.ajaxSettings, options, {
[378] Fix | Delete
contentType : false,
[379] Fix | Delete
processData : false,
[380] Fix | Delete
cache : false,
[381] Fix | Delete
type : method || 'POST'
[382] Fix | Delete
});
[383] Fix | Delete
[384] Fix | Delete
if (options.uploadProgress) {
[385] Fix | Delete
// workaround because jqXHR does not expose upload property
[386] Fix | Delete
s.xhr = function() {
[387] Fix | Delete
var xhr = $.ajaxSettings.xhr();
[388] Fix | Delete
[389] Fix | Delete
if (xhr.upload) {
[390] Fix | Delete
xhr.upload.addEventListener('progress', function(event) {
[391] Fix | Delete
var percent = 0;
[392] Fix | Delete
var position = event.loaded || event.position; /* event.position is deprecated */
[393] Fix | Delete
var total = event.total;
[394] Fix | Delete
[395] Fix | Delete
if (event.lengthComputable) {
[396] Fix | Delete
percent = Math.ceil(position / total * 100);
[397] Fix | Delete
}
[398] Fix | Delete
[399] Fix | Delete
options.uploadProgress(event, position, total, percent);
[400] Fix | Delete
}, false);
[401] Fix | Delete
}
[402] Fix | Delete
[403] Fix | Delete
return xhr;
[404] Fix | Delete
};
[405] Fix | Delete
}
[406] Fix | Delete
[407] Fix | Delete
s.data = null;
[408] Fix | Delete
[409] Fix | Delete
var beforeSend = s.beforeSend;
[410] Fix | Delete
[411] Fix | Delete
s.beforeSend = function(xhr, o) {
[412] Fix | Delete
// Send FormData() provided by user
[413] Fix | Delete
if (options.formData) {
[414] Fix | Delete
o.data = options.formData;
[415] Fix | Delete
} else {
[416] Fix | Delete
o.data = formdata;
[417] Fix | Delete
}
[418] Fix | Delete
[419] Fix | Delete
if (beforeSend) {
[420] Fix | Delete
beforeSend.call(this, xhr, o);
[421] Fix | Delete
}
[422] Fix | Delete
};
[423] Fix | Delete
[424] Fix | Delete
return $.ajax(s);
[425] Fix | Delete
}
[426] Fix | Delete
[427] Fix | Delete
// private function for handling file uploads (hat tip to YAHOO!)
[428] Fix | Delete
function fileUploadIframe(a) {
[429] Fix | Delete
var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
[430] Fix | Delete
var deferred = $.Deferred();
[431] Fix | Delete
[432] Fix | Delete
// #341
[433] Fix | Delete
deferred.abort = function(status) {
[434] Fix | Delete
xhr.abort(status);
[435] Fix | Delete
};
[436] Fix | Delete
[437] Fix | Delete
if (a) {
[438] Fix | Delete
// ensure that every serialized input is still enabled
[439] Fix | Delete
for (i = 0; i < elements.length; i++) {
[440] Fix | Delete
el = $(elements[i]);
[441] Fix | Delete
if (hasProp) {
[442] Fix | Delete
el.prop('disabled', false);
[443] Fix | Delete
} else {
[444] Fix | Delete
el.removeAttr('disabled');
[445] Fix | Delete
}
[446] Fix | Delete
}
[447] Fix | Delete
}
[448] Fix | Delete
[449] Fix | Delete
s = $.extend(true, {}, $.ajaxSettings, options);
[450] Fix | Delete
s.context = s.context || s;
[451] Fix | Delete
id = 'jqFormIO' + new Date().getTime();
[452] Fix | Delete
var ownerDocument = form.ownerDocument;
[453] Fix | Delete
var $body = $form.closest('body');
[454] Fix | Delete
[455] Fix | Delete
if (s.iframeTarget) {
[456] Fix | Delete
$io = $(s.iframeTarget, ownerDocument);
[457] Fix | Delete
n = $io.attr2('name');
[458] Fix | Delete
if (!n) {
[459] Fix | Delete
$io.attr2('name', id);
[460] Fix | Delete
} else {
[461] Fix | Delete
id = n;
[462] Fix | Delete
}
[463] Fix | Delete
[464] Fix | Delete
} else {
[465] Fix | Delete
$io = $('<iframe name="' + id + '" src="' + s.iframeSrc + '" />', ownerDocument);
[466] Fix | Delete
$io.css({position: 'absolute', top: '-1000px', left: '-1000px'});
[467] Fix | Delete
}
[468] Fix | Delete
io = $io[0];
[469] Fix | Delete
[470] Fix | Delete
[471] Fix | Delete
xhr = { // mock object
[472] Fix | Delete
aborted : 0,
[473] Fix | Delete
responseText : null,
[474] Fix | Delete
responseXML : null,
[475] Fix | Delete
status : 0,
[476] Fix | Delete
statusText : 'n/a',
[477] Fix | Delete
getAllResponseHeaders : function() {},
[478] Fix | Delete
getResponseHeader : function() {},
[479] Fix | Delete
setRequestHeader : function() {},
[480] Fix | Delete
abort : function(status) {
[481] Fix | Delete
var e = (status === 'timeout' ? 'timeout' : 'aborted');
[482] Fix | Delete
[483] Fix | Delete
log('aborting upload... ' + e);
[484] Fix | Delete
this.aborted = 1;
[485] Fix | Delete
[486] Fix | Delete
try { // #214, #257
[487] Fix | Delete
if (io.contentWindow.document.execCommand) {
[488] Fix | Delete
io.contentWindow.document.execCommand('Stop');
[489] Fix | Delete
}
[490] Fix | Delete
} catch (ignore) {}
[491] Fix | Delete
[492] Fix | Delete
$io.attr('src', s.iframeSrc); // abort op in progress
[493] Fix | Delete
xhr.error = e;
[494] Fix | Delete
if (s.error) {
[495] Fix | Delete
s.error.call(s.context, xhr, e, status);
[496] Fix | Delete
}
[497] Fix | Delete
[498] Fix | Delete
if (g) {
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function