mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-24 09:50:26 +00:00
Ajaxclick function will now detect if it's an external link, and if so, it won't use Ajax.
This commit is contained in:
parent
91c5b90c82
commit
aeb2643bdc
1 changed files with 6 additions and 5 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue