Browse files

Fix for #1990: Introducing $.mobile.ajaxCrossDomainEnabled defaults t…

…o false
  • Loading branch information...
1 parent 2b51355 commit 5fe310600f64c8cec385a0496ef835398472bfcc @gseguin committed Jun 29, 2011
Showing with 12 additions and 0 deletions.
  1. +3 −0 js/jquery.mobile.core.js
  2. +9 −0 js/jquery.mobile.navigation.js
View
3 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,
View
9 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,

0 comments on commit 5fe3106

Please sign in to comment.