diff --git a/js/jquery.mobile.core.js b/js/jquery.mobile.core.js index 4fe4ab52..e8827400 100644 --- a/js/jquery.mobile.core.js +++ b/js/jquery.mobile.core.js @@ -33,6 +33,9 @@ // Automatically handle clicks and form submissions through Ajax, when same-domain ajaxEnabled: true, + // Allow cross domain XHR, use at your own risks + ajaxCrossDomainEnabled: false, + // Automatically load and show pages based on location.hash hashListeningEnabled: true, diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 27c41b0d..4283ef39 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -612,6 +612,15 @@ $.mobile.showPageLoadingMsg(); } + $.ajaxTransport("+*", function( s ) { + if ( s.crossDomain && !$.mobile.ajaxCrossDomainEnabled ) { + return { + send: $.noop, + abort: $.noop + }; + } + }); + // Load the new page. $.ajax({ url: fileUrl,