Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/jquery
File: jquery.form.js
this.aborted = 1;
[500] Fix | Delete
[501] Fix | Delete
try { // #214, #257
[502] Fix | Delete
if (io.contentWindow.document.execCommand) {
[503] Fix | Delete
io.contentWindow.document.execCommand('Stop');
[504] Fix | Delete
}
[505] Fix | Delete
} catch (ignore) {}
[506] Fix | Delete
[507] Fix | Delete
$io.attr('src', s.iframeSrc); // abort op in progress
[508] Fix | Delete
xhr.error = e;
[509] Fix | Delete
if (s.error) {
[510] Fix | Delete
s.error.call(s.context, xhr, e, status);
[511] Fix | Delete
}
[512] Fix | Delete
[513] Fix | Delete
if (g) {
[514] Fix | Delete
$.event.trigger('ajaxError', [xhr, s, e]);
[515] Fix | Delete
}
[516] Fix | Delete
[517] Fix | Delete
if (s.complete) {
[518] Fix | Delete
s.complete.call(s.context, xhr, e);
[519] Fix | Delete
}
[520] Fix | Delete
}
[521] Fix | Delete
};
[522] Fix | Delete
[523] Fix | Delete
g = s.global;
[524] Fix | Delete
// trigger ajax global events so that activity/block indicators work like normal
[525] Fix | Delete
if (g && $.active++ === 0) {
[526] Fix | Delete
$.event.trigger('ajaxStart');
[527] Fix | Delete
}
[528] Fix | Delete
if (g) {
[529] Fix | Delete
$.event.trigger('ajaxSend', [xhr, s]);
[530] Fix | Delete
}
[531] Fix | Delete
[532] Fix | Delete
if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
[533] Fix | Delete
if (s.global) {
[534] Fix | Delete
$.active--;
[535] Fix | Delete
}
[536] Fix | Delete
deferred.reject();
[537] Fix | Delete
[538] Fix | Delete
return deferred;
[539] Fix | Delete
}
[540] Fix | Delete
[541] Fix | Delete
if (xhr.aborted) {
[542] Fix | Delete
deferred.reject();
[543] Fix | Delete
[544] Fix | Delete
return deferred;
[545] Fix | Delete
}
[546] Fix | Delete
[547] Fix | Delete
// add submitting element to data if we know it
[548] Fix | Delete
sub = form.clk;
[549] Fix | Delete
if (sub) {
[550] Fix | Delete
n = sub.name;
[551] Fix | Delete
if (n && !sub.disabled) {
[552] Fix | Delete
s.extraData = s.extraData || {};
[553] Fix | Delete
s.extraData[n] = sub.value;
[554] Fix | Delete
if (sub.type === 'image') {
[555] Fix | Delete
s.extraData[n + '.x'] = form.clk_x;
[556] Fix | Delete
s.extraData[n + '.y'] = form.clk_y;
[557] Fix | Delete
}
[558] Fix | Delete
}
[559] Fix | Delete
}
[560] Fix | Delete
[561] Fix | Delete
var CLIENT_TIMEOUT_ABORT = 1;
[562] Fix | Delete
var SERVER_ABORT = 2;
[563] Fix | Delete
[564] Fix | Delete
function getDoc(frame) {
[565] Fix | Delete
/* it looks like contentWindow or contentDocument do not
[566] Fix | Delete
* carry the protocol property in ie8, when running under ssl
[567] Fix | Delete
* frame.document is the only valid response document, since
[568] Fix | Delete
* the protocol is know but not on the other two objects. strange?
[569] Fix | Delete
* "Same origin policy" http://en.wikipedia.org/wiki/Same_origin_policy
[570] Fix | Delete
*/
[571] Fix | Delete
[572] Fix | Delete
var doc = null;
[573] Fix | Delete
[574] Fix | Delete
// IE8 cascading access check
[575] Fix | Delete
try {
[576] Fix | Delete
if (frame.contentWindow) {
[577] Fix | Delete
doc = frame.contentWindow.document;
[578] Fix | Delete
}
[579] Fix | Delete
} catch (err) {
[580] Fix | Delete
// IE8 access denied under ssl & missing protocol
[581] Fix | Delete
log('cannot get iframe.contentWindow document: ' + err);
[582] Fix | Delete
}
[583] Fix | Delete
[584] Fix | Delete
if (doc) { // successful getting content
[585] Fix | Delete
return doc;
[586] Fix | Delete
}
[587] Fix | Delete
[588] Fix | Delete
try { // simply checking may throw in ie8 under ssl or mismatched protocol
[589] Fix | Delete
doc = frame.contentDocument ? frame.contentDocument : frame.document;
[590] Fix | Delete
} catch (err) {
[591] Fix | Delete
// last attempt
[592] Fix | Delete
log('cannot get iframe.contentDocument: ' + err);
[593] Fix | Delete
doc = frame.document;
[594] Fix | Delete
}
[595] Fix | Delete
[596] Fix | Delete
return doc;
[597] Fix | Delete
}
[598] Fix | Delete
[599] Fix | Delete
// Rails CSRF hack (thanks to Yvan Barthelemy)
[600] Fix | Delete
var csrf_token = $('meta[name=csrf-token]').attr('content');
[601] Fix | Delete
var csrf_param = $('meta[name=csrf-param]').attr('content');
[602] Fix | Delete
[603] Fix | Delete
if (csrf_param && csrf_token) {
[604] Fix | Delete
s.extraData = s.extraData || {};
[605] Fix | Delete
s.extraData[csrf_param] = csrf_token;
[606] Fix | Delete
}
[607] Fix | Delete
[608] Fix | Delete
// take a breath so that pending repaints get some cpu time before the upload starts
[609] Fix | Delete
function doSubmit() {
[610] Fix | Delete
// make sure form attrs are set
[611] Fix | Delete
var t = $form.attr2('target'),
[612] Fix | Delete
a = $form.attr2('action'),
[613] Fix | Delete
mp = 'multipart/form-data',
[614] Fix | Delete
et = $form.attr('enctype') || $form.attr('encoding') || mp;
[615] Fix | Delete
[616] Fix | Delete
// update form attrs in IE friendly way
[617] Fix | Delete
form.setAttribute('target', id);
[618] Fix | Delete
if (!method || /post/i.test(method)) {
[619] Fix | Delete
form.setAttribute('method', 'POST');
[620] Fix | Delete
}
[621] Fix | Delete
if (a !== s.url) {
[622] Fix | Delete
form.setAttribute('action', s.url);
[623] Fix | Delete
}
[624] Fix | Delete
[625] Fix | Delete
// ie borks in some cases when setting encoding
[626] Fix | Delete
if (!s.skipEncodingOverride && (!method || /post/i.test(method))) {
[627] Fix | Delete
$form.attr({
[628] Fix | Delete
encoding : 'multipart/form-data',
[629] Fix | Delete
enctype : 'multipart/form-data'
[630] Fix | Delete
});
[631] Fix | Delete
}
[632] Fix | Delete
[633] Fix | Delete
// support timout
[634] Fix | Delete
if (s.timeout) {
[635] Fix | Delete
timeoutHandle = setTimeout(function() {
[636] Fix | Delete
timedOut = true; cb(CLIENT_TIMEOUT_ABORT);
[637] Fix | Delete
}, s.timeout);
[638] Fix | Delete
}
[639] Fix | Delete
[640] Fix | Delete
// look for server aborts
[641] Fix | Delete
function checkState() {
[642] Fix | Delete
try {
[643] Fix | Delete
var state = getDoc(io).readyState;
[644] Fix | Delete
[645] Fix | Delete
log('state = ' + state);
[646] Fix | Delete
if (state && state.toLowerCase() === 'uninitialized') {
[647] Fix | Delete
setTimeout(checkState, 50);
[648] Fix | Delete
}
[649] Fix | Delete
[650] Fix | Delete
} catch (e) {
[651] Fix | Delete
log('Server abort: ', e, ' (', e.name, ')');
[652] Fix | Delete
cb(SERVER_ABORT); // eslint-disable-line callback-return
[653] Fix | Delete
if (timeoutHandle) {
[654] Fix | Delete
clearTimeout(timeoutHandle);
[655] Fix | Delete
}
[656] Fix | Delete
timeoutHandle = undefined;
[657] Fix | Delete
}
[658] Fix | Delete
}
[659] Fix | Delete
[660] Fix | Delete
// add "extra" data to form if provided in options
[661] Fix | Delete
var extraInputs = [];
[662] Fix | Delete
[663] Fix | Delete
try {
[664] Fix | Delete
if (s.extraData) {
[665] Fix | Delete
for (var n in s.extraData) {
[666] Fix | Delete
if (s.extraData.hasOwnProperty(n)) {
[667] Fix | Delete
// if using the $.param format that allows for multiple values with the same name
[668] Fix | Delete
if ($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {
[669] Fix | Delete
extraInputs.push(
[670] Fix | Delete
$('<input type="hidden" name="' + s.extraData[n].name + '">', ownerDocument).val(s.extraData[n].value)
[671] Fix | Delete
.appendTo(form)[0]);
[672] Fix | Delete
} else {
[673] Fix | Delete
extraInputs.push(
[674] Fix | Delete
$('<input type="hidden" name="' + n + '">', ownerDocument).val(s.extraData[n])
[675] Fix | Delete
.appendTo(form)[0]);
[676] Fix | Delete
}
[677] Fix | Delete
}
[678] Fix | Delete
}
[679] Fix | Delete
}
[680] Fix | Delete
[681] Fix | Delete
if (!s.iframeTarget) {
[682] Fix | Delete
// add iframe to doc and submit the form
[683] Fix | Delete
$io.appendTo($body);
[684] Fix | Delete
}
[685] Fix | Delete
[686] Fix | Delete
if (io.attachEvent) {
[687] Fix | Delete
io.attachEvent('onload', cb);
[688] Fix | Delete
} else {
[689] Fix | Delete
io.addEventListener('load', cb, false);
[690] Fix | Delete
}
[691] Fix | Delete
[692] Fix | Delete
setTimeout(checkState, 15);
[693] Fix | Delete
[694] Fix | Delete
try {
[695] Fix | Delete
form.submit();
[696] Fix | Delete
[697] Fix | Delete
} catch (err) {
[698] Fix | Delete
// just in case form has element with name/id of 'submit'
[699] Fix | Delete
var submitFn = document.createElement('form').submit;
[700] Fix | Delete
[701] Fix | Delete
submitFn.apply(form);
[702] Fix | Delete
}
[703] Fix | Delete
[704] Fix | Delete
} finally {
[705] Fix | Delete
// reset attrs and remove "extra" input elements
[706] Fix | Delete
form.setAttribute('action', a);
[707] Fix | Delete
form.setAttribute('enctype', et); // #380
[708] Fix | Delete
if (t) {
[709] Fix | Delete
form.setAttribute('target', t);
[710] Fix | Delete
} else {
[711] Fix | Delete
$form.removeAttr('target');
[712] Fix | Delete
}
[713] Fix | Delete
$(extraInputs).remove();
[714] Fix | Delete
}
[715] Fix | Delete
}
[716] Fix | Delete
[717] Fix | Delete
if (s.forceSync) {
[718] Fix | Delete
doSubmit();
[719] Fix | Delete
} else {
[720] Fix | Delete
setTimeout(doSubmit, 10); // this lets dom updates render
[721] Fix | Delete
}
[722] Fix | Delete
[723] Fix | Delete
var data, doc, domCheckCount = 50, callbackProcessed;
[724] Fix | Delete
[725] Fix | Delete
function cb(e) {
[726] Fix | Delete
if (xhr.aborted || callbackProcessed) {
[727] Fix | Delete
return;
[728] Fix | Delete
}
[729] Fix | Delete
[730] Fix | Delete
doc = getDoc(io);
[731] Fix | Delete
if (!doc) {
[732] Fix | Delete
log('cannot access response document');
[733] Fix | Delete
e = SERVER_ABORT;
[734] Fix | Delete
}
[735] Fix | Delete
if (e === CLIENT_TIMEOUT_ABORT && xhr) {
[736] Fix | Delete
xhr.abort('timeout');
[737] Fix | Delete
deferred.reject(xhr, 'timeout');
[738] Fix | Delete
[739] Fix | Delete
return;
[740] Fix | Delete
[741] Fix | Delete
}
[742] Fix | Delete
if (e === SERVER_ABORT && xhr) {
[743] Fix | Delete
xhr.abort('server abort');
[744] Fix | Delete
deferred.reject(xhr, 'error', 'server abort');
[745] Fix | Delete
[746] Fix | Delete
return;
[747] Fix | Delete
}
[748] Fix | Delete
[749] Fix | Delete
if (!doc || doc.location.href === s.iframeSrc) {
[750] Fix | Delete
// response not received yet
[751] Fix | Delete
if (!timedOut) {
[752] Fix | Delete
return;
[753] Fix | Delete
}
[754] Fix | Delete
}
[755] Fix | Delete
[756] Fix | Delete
if (io.detachEvent) {
[757] Fix | Delete
io.detachEvent('onload', cb);
[758] Fix | Delete
} else {
[759] Fix | Delete
io.removeEventListener('load', cb, false);
[760] Fix | Delete
}
[761] Fix | Delete
[762] Fix | Delete
var status = 'success', errMsg;
[763] Fix | Delete
[764] Fix | Delete
try {
[765] Fix | Delete
if (timedOut) {
[766] Fix | Delete
throw 'timeout';
[767] Fix | Delete
}
[768] Fix | Delete
[769] Fix | Delete
var isXml = s.dataType === 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
[770] Fix | Delete
[771] Fix | Delete
log('isXml=' + isXml);
[772] Fix | Delete
[773] Fix | Delete
if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) {
[774] Fix | Delete
if (--domCheckCount) {
[775] Fix | Delete
// in some browsers (Opera) the iframe DOM is not always traversable when
[776] Fix | Delete
// the onload callback fires, so we loop a bit to accommodate
[777] Fix | Delete
log('requeing onLoad callback, DOM not available');
[778] Fix | Delete
setTimeout(cb, 250);
[779] Fix | Delete
[780] Fix | Delete
return;
[781] Fix | Delete
}
[782] Fix | Delete
// let this fall through because server response could be an empty document
[783] Fix | Delete
// log('Could not access iframe DOM after mutiple tries.');
[784] Fix | Delete
// throw 'DOMException: not available';
[785] Fix | Delete
}
[786] Fix | Delete
[787] Fix | Delete
// log('response detected');
[788] Fix | Delete
var docRoot = doc.body ? doc.body : doc.documentElement;
[789] Fix | Delete
[790] Fix | Delete
xhr.responseText = docRoot ? docRoot.innerHTML : null;
[791] Fix | Delete
xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
[792] Fix | Delete
if (isXml) {
[793] Fix | Delete
s.dataType = 'xml';
[794] Fix | Delete
}
[795] Fix | Delete
xhr.getResponseHeader = function(header){
[796] Fix | Delete
var headers = {'content-type': s.dataType};
[797] Fix | Delete
[798] Fix | Delete
return headers[header.toLowerCase()];
[799] Fix | Delete
};
[800] Fix | Delete
// support for XHR 'status' & 'statusText' emulation :
[801] Fix | Delete
if (docRoot) {
[802] Fix | Delete
xhr.status = Number(docRoot.getAttribute('status')) || xhr.status;
[803] Fix | Delete
xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
[804] Fix | Delete
}
[805] Fix | Delete
[806] Fix | Delete
var dt = (s.dataType || '').toLowerCase();
[807] Fix | Delete
var scr = /(json|script|text)/.test(dt);
[808] Fix | Delete
[809] Fix | Delete
if (scr || s.textarea) {
[810] Fix | Delete
// see if user embedded response in textarea
[811] Fix | Delete
var ta = doc.getElementsByTagName('textarea')[0];
[812] Fix | Delete
[813] Fix | Delete
if (ta) {
[814] Fix | Delete
xhr.responseText = ta.value;
[815] Fix | Delete
// support for XHR 'status' & 'statusText' emulation :
[816] Fix | Delete
xhr.status = Number(ta.getAttribute('status')) || xhr.status;
[817] Fix | Delete
xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
[818] Fix | Delete
[819] Fix | Delete
} else if (scr) {
[820] Fix | Delete
// account for browsers injecting pre around json response
[821] Fix | Delete
var pre = doc.getElementsByTagName('pre')[0];
[822] Fix | Delete
var b = doc.getElementsByTagName('body')[0];
[823] Fix | Delete
[824] Fix | Delete
if (pre) {
[825] Fix | Delete
xhr.responseText = pre.textContent ? pre.textContent : pre.innerText;
[826] Fix | Delete
} else if (b) {
[827] Fix | Delete
xhr.responseText = b.textContent ? b.textContent : b.innerText;
[828] Fix | Delete
}
[829] Fix | Delete
}
[830] Fix | Delete
[831] Fix | Delete
} else if (dt === 'xml' && !xhr.responseXML && xhr.responseText) {
[832] Fix | Delete
xhr.responseXML = toXml(xhr.responseText); // eslint-disable-line no-use-before-define
[833] Fix | Delete
}
[834] Fix | Delete
[835] Fix | Delete
try {
[836] Fix | Delete
data = httpData(xhr, dt, s); // eslint-disable-line no-use-before-define
[837] Fix | Delete
[838] Fix | Delete
} catch (err) {
[839] Fix | Delete
status = 'parsererror';
[840] Fix | Delete
xhr.error = errMsg = (err || status);
[841] Fix | Delete
}
[842] Fix | Delete
[843] Fix | Delete
} catch (err) {
[844] Fix | Delete
log('error caught: ', err);
[845] Fix | Delete
status = 'error';
[846] Fix | Delete
xhr.error = errMsg = (err || status);
[847] Fix | Delete
}
[848] Fix | Delete
[849] Fix | Delete
if (xhr.aborted) {
[850] Fix | Delete
log('upload aborted');
[851] Fix | Delete
status = null;
[852] Fix | Delete
}
[853] Fix | Delete
[854] Fix | Delete
if (xhr.status) { // we've set xhr.status
[855] Fix | Delete
status = ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304) ? 'success' : 'error';
[856] Fix | Delete
}
[857] Fix | Delete
[858] Fix | Delete
// ordering of these callbacks/triggers is odd, but that's how $.ajax does it
[859] Fix | Delete
if (status === 'success') {
[860] Fix | Delete
if (s.success) {
[861] Fix | Delete
s.success.call(s.context, data, 'success', xhr);
[862] Fix | Delete
}
[863] Fix | Delete
[864] Fix | Delete
deferred.resolve(xhr.responseText, 'success', xhr);
[865] Fix | Delete
[866] Fix | Delete
if (g) {
[867] Fix | Delete
$.event.trigger('ajaxSuccess', [xhr, s]);
[868] Fix | Delete
}
[869] Fix | Delete
[870] Fix | Delete
} else if (status) {
[871] Fix | Delete
if (typeof errMsg === 'undefined') {
[872] Fix | Delete
errMsg = xhr.statusText;
[873] Fix | Delete
}
[874] Fix | Delete
if (s.error) {
[875] Fix | Delete
s.error.call(s.context, xhr, status, errMsg);
[876] Fix | Delete
}
[877] Fix | Delete
deferred.reject(xhr, 'error', errMsg);
[878] Fix | Delete
if (g) {
[879] Fix | Delete
$.event.trigger('ajaxError', [xhr, s, errMsg]);
[880] Fix | Delete
}
[881] Fix | Delete
}
[882] Fix | Delete
[883] Fix | Delete
if (g) {
[884] Fix | Delete
$.event.trigger('ajaxComplete', [xhr, s]);
[885] Fix | Delete
}
[886] Fix | Delete
[887] Fix | Delete
if (g && !--$.active) {
[888] Fix | Delete
$.event.trigger('ajaxStop');
[889] Fix | Delete
}
[890] Fix | Delete
[891] Fix | Delete
if (s.complete) {
[892] Fix | Delete
s.complete.call(s.context, xhr, status);
[893] Fix | Delete
}
[894] Fix | Delete
[895] Fix | Delete
callbackProcessed = true;
[896] Fix | Delete
if (s.timeout) {
[897] Fix | Delete
clearTimeout(timeoutHandle);
[898] Fix | Delete
}
[899] Fix | Delete
[900] Fix | Delete
// clean up
[901] Fix | Delete
setTimeout(function() {
[902] Fix | Delete
if (!s.iframeTarget) {
[903] Fix | Delete
$io.remove();
[904] Fix | Delete
} else { // adding else to clean up existing iframe response.
[905] Fix | Delete
$io.attr('src', s.iframeSrc);
[906] Fix | Delete
}
[907] Fix | Delete
xhr.responseXML = null;
[908] Fix | Delete
}, 100);
[909] Fix | Delete
}
[910] Fix | Delete
[911] Fix | Delete
var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
[912] Fix | Delete
if (window.ActiveXObject) {
[913] Fix | Delete
doc = new ActiveXObject('Microsoft.XMLDOM');
[914] Fix | Delete
doc.async = 'false';
[915] Fix | Delete
doc.loadXML(s);
[916] Fix | Delete
[917] Fix | Delete
} else {
[918] Fix | Delete
doc = (new DOMParser()).parseFromString(s, 'text/xml');
[919] Fix | Delete
}
[920] Fix | Delete
[921] Fix | Delete
return (doc && doc.documentElement && doc.documentElement.nodeName !== 'parsererror') ? doc : null;
[922] Fix | Delete
};
[923] Fix | Delete
var parseJSON = $.parseJSON || function(s) {
[924] Fix | Delete
/* jslint evil:true */
[925] Fix | Delete
return window['eval']('(' + s + ')'); // eslint-disable-line dot-notation
[926] Fix | Delete
};
[927] Fix | Delete
[928] Fix | Delete
var httpData = function(xhr, type, s) { // mostly lifted from jq1.4.4
[929] Fix | Delete
[930] Fix | Delete
var ct = xhr.getResponseHeader('content-type') || '',
[931] Fix | Delete
xml = ((type === 'xml' || !type) && ct.indexOf('xml') >= 0),
[932] Fix | Delete
data = xml ? xhr.responseXML : xhr.responseText;
[933] Fix | Delete
[934] Fix | Delete
if (xml && data.documentElement.nodeName === 'parsererror') {
[935] Fix | Delete
if ($.error) {
[936] Fix | Delete
$.error('parsererror');
[937] Fix | Delete
}
[938] Fix | Delete
}
[939] Fix | Delete
if (s && s.dataFilter) {
[940] Fix | Delete
data = s.dataFilter(data, type);
[941] Fix | Delete
}
[942] Fix | Delete
if (typeof data === 'string') {
[943] Fix | Delete
if ((type === 'json' || !type) && ct.indexOf('json') >= 0) {
[944] Fix | Delete
data = parseJSON(data);
[945] Fix | Delete
} else if ((type === 'script' || !type) && ct.indexOf('javascript') >= 0) {
[946] Fix | Delete
$.globalEval(data);
[947] Fix | Delete
}
[948] Fix | Delete
}
[949] Fix | Delete
[950] Fix | Delete
return data;
[951] Fix | Delete
};
[952] Fix | Delete
[953] Fix | Delete
return deferred;
[954] Fix | Delete
}
[955] Fix | Delete
};
[956] Fix | Delete
[957] Fix | Delete
/**
[958] Fix | Delete
* ajaxForm() provides a mechanism for fully automating form submission.
[959] Fix | Delete
*
[960] Fix | Delete
* The advantages of using this method instead of ajaxSubmit() are:
[961] Fix | Delete
*
[962] Fix | Delete
* 1: This method will include coordinates for <input type="image"> elements (if the element
[963] Fix | Delete
* is used to submit the form).
[964] Fix | Delete
* 2. This method will include the submit element's name/value data (for the element that was
[965] Fix | Delete
* used to submit the form).
[966] Fix | Delete
* 3. This method binds the submit() method to the form for you.
[967] Fix | Delete
*
[968] Fix | Delete
* The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely
[969] Fix | Delete
* passes the options argument along after properly binding events for submit elements and
[970] Fix | Delete
* the form itself.
[971] Fix | Delete
*/
[972] Fix | Delete
$.fn.ajaxForm = function(options, data, dataType, onSuccess) {
[973] Fix | Delete
if (typeof options === 'string' || (options === false && arguments.length > 0)) {
[974] Fix | Delete
options = {
[975] Fix | Delete
'url' : options,
[976] Fix | Delete
'data' : data,
[977] Fix | Delete
'dataType' : dataType
[978] Fix | Delete
};
[979] Fix | Delete
[980] Fix | Delete
if (typeof onSuccess === 'function') {
[981] Fix | Delete
options.success = onSuccess;
[982] Fix | Delete
}
[983] Fix | Delete
}
[984] Fix | Delete
[985] Fix | Delete
options = options || {};
[986] Fix | Delete
options.delegation = options.delegation && $.isFunction($.fn.on);
[987] Fix | Delete
[988] Fix | Delete
// in jQuery 1.3+ we can fix mistakes with the ready state
[989] Fix | Delete
if (!options.delegation && this.length === 0) {
[990] Fix | Delete
var o = {s: this.selector, c: this.context};
[991] Fix | Delete
[992] Fix | Delete
if (!$.isReady && o.s) {
[993] Fix | Delete
log('DOM not ready, queuing ajaxForm');
[994] Fix | Delete
$(function() {
[995] Fix | Delete
$(o.s, o.c).ajaxForm(options);
[996] Fix | Delete
});
[997] Fix | Delete
[998] Fix | Delete
return this;
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function