From fa794ca0eeb1420d2ba4dcbd48bc17ea695e1a27 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Tue, 2 Nov 2010 00:57:27 -0400 Subject: [PATCH] made sure external form actions are submitted through http --- js/jquery.mobile.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/js/jquery.mobile.js b/js/jquery.mobile.js index ee51e33b..44b89f34 100644 --- a/js/jquery.mobile.js +++ b/js/jquery.mobile.js @@ -108,8 +108,12 @@ //for form submission $('form').live('submit', function(){ var type = $(this).attr("method"), - url = $(this).attr( "action" ).replace( location.protocol + "//" + location.host, ""), - external = /^(:?\w+:)/.test( url ); + url = $(this).attr( "action" ).replace( location.protocol + "//" + location.host, ""); + + //external submits use regular HTTP + if( /^(:?\w+:)/.test( url ) ){ + return; + } //if it's a relative href, prefix href with base url if( url.indexOf('/') && url.indexOf('#') !== 0 ){ @@ -126,9 +130,7 @@ type === "get" ); return false; - }); - - + }); //click routing - direct to HTTP or Ajax, accordingly jQuery( "a" ).live( "click", function(event) {