From aeb2643bdcef2e43e08e159b7fb112a33552cc2f Mon Sep 17 00:00:00 2001 From: scottjehl Date: Sat, 2 Oct 2010 12:18:45 -0400 Subject: [PATCH] Ajaxclick function will now detect if it's an external link, and if so, it won't use Ajax. --- js/jQuery.mobile.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/js/jQuery.mobile.js b/js/jQuery.mobile.js index a612fed1..b2e4bee0 100644 --- a/js/jQuery.mobile.js +++ b/js/jQuery.mobile.js @@ -59,13 +59,14 @@ pageTransition = jQuery( this ).attr( "data-transition" ) || "slide"; nextPageRole = jQuery( this ).attr( "data-rel" ); - // let the hashchange event handler take care of everything else - location.hash = href; - - // note: if it's a non-local-anchor and Ajax is not supported, go to page - if ( href.match( /^[^#]/ ) && !jQuery.support.ajax ) { + //if it's a non-local-anchor and Ajax is not supported, or if it's an external link, go to page without ajax + if ( (href.match( /^[^#]/ ) && !jQuery.support.ajax) || (href.match(/https?:\/\//) && !href.match(location.hostname)) ) { window.location = href; } + else{ + // let the hashchange event handler take care of requesting the page via ajax + location.hash = href; + } return this; };