Skip to content

Commit

Permalink
Handle hashed and naked hash actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike authored and Mike committed May 9, 2009
1 parent 8f8b414 commit 7845507
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions jquery.form.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* jQuery Form Plugin
* version: 2.25 (08-APR-2009)
* version: 2.27 (09-MAY-2009)
* @requires jQuery v1.2.2 or later
*
* Examples and documentation at: http://malsup.com/jquery/form/
Expand Down Expand Up @@ -53,10 +53,12 @@ $.fn.ajaxSubmit = function(options) {
if (typeof options == 'function')
options = { success: options };

// clean url (don't include hash vaue)
var url = this.attr('action') || window.location.href;
url = (url.match(/^([^#]+)/)||[])[1];
url = url || '';
var url = $.trim(this.attr('action'));
if (url) {
// clean url (don't include hash vaue)
url = (url.match(/^([^#]+)/)||[])[1];
}
url = url || window.location.href || ''

options = $.extend({
url: url,
Expand Down Expand Up @@ -139,8 +141,12 @@ $.fn.ajaxSubmit = function(options) {
if (files[j])
found = true;

var multipart = false;
// var mp = 'multipart/form-data';
// multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);

// options.iframe allows user to force iframe mode
if (options.iframe || found) {
if (options.iframe || found || multipart) {
// hack to fix Safari hang (thanks to Tim Molendijk for this)
// see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
if (options.closeKeepAlive)
Expand Down

0 comments on commit 7845507

Please sign in to comment.