Skip to content

Commit

Permalink
Still use 'javascript:false' for IE
Browse files Browse the repository at this point in the history
Uses code from @KorvinSzanto pull request jquery-form/form#572
  • Loading branch information
bikerdave committed May 26, 2020
1 parent ce19bc9 commit 2b81786
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions js/build/vendor/jquery-form/jquery-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ $.fn.ajaxSubmit = function(options) {
log('ajaxSubmit: skipping submit process - no element selected');
return this;
}
var method, action, url, $form = this;

var method, action, url, isMsie, iframeSrc, $form = this;

if (typeof options == 'function') {
options = { success: options };
Expand All @@ -65,11 +65,15 @@ $.fn.ajaxSubmit = function(options) {
url = (url.match(/^([^#]+)/)||[])[1];
}

// 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';

options = $.extend(true, {
url: url,
success: $.ajaxSettings.success,
type: method || 'GET',
iframeSrc: 'about:blank'
iframeSrc : iframeSrc
}, options);

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

0 comments on commit 2b81786

Please sign in to comment.