made sure external form actions are submitted through http

This commit is contained in:
scottjehl 2010-11-02 00:57:27 -04:00
parent bb54ee9645
commit fa794ca0ee

View file

@ -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) {