Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/jquery.form.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
}

/* eslint consistent-this: ["error", "$form"] */
var method, action, url, $form = this;
var method, action, url, isMsie, iframeSrc, $form = this;

if (typeof options === 'function') {
options = {success: options};
Expand Down Expand Up @@ -154,12 +154,16 @@
// clean url (don't include hash vaue)
url = (url.match(/^([^#]+)/) || [])[1];
}
// IE requires javascript:false in https, but this breaks chrome >83 and goes against spec.
// Instead of using javascript:false always, let's only apply it for IE.
isMsie = /(MSIE|Trident)/.test(navigator.userAgent || '');
iframeSrc = (isMsie && /^https/i.test(window.location.href || '')) ? 'javascript:false' : 'about:blank'; // eslint-disable-line no-script-url

options = $.extend(true, {
url : url,
success : $.ajaxSettings.success,
type : method || $.ajaxSettings.type,
iframeSrc : /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' // eslint-disable-line no-script-url
iframeSrc : iframeSrc
}, options);

// hook for manipulating the form data before it is extracted;
Expand Down