mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-26 10:40:44 +00:00
made sure external form actions are submitted through http
This commit is contained in:
parent
bb54ee9645
commit
fa794ca0ee
1 changed files with 7 additions and 5 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue