This repository was archived by the owner on Oct 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Ajax and "base" tag #3273
Closed
Closed
Ajax and "base" tag #3273
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1e94a90
Ajax didnt work with $.support.dynamicBaseTag. Fixed.
jguyomard 95b1705
Merge remote branch 'upstream/master'
jguyomard 18602ba
When an original base tag is defined in HTML, $.support.dynamicBaseTa…
2543a0d
Merge branch 'master' of github.com:jguyomard/jquery-mobile
jguyomard b4c3e3d
getClosestBaseURL works now with ajax link when an original base tag …
jguyomard 5219bbb
Merge remote branch 'upstream/master'
jguyomard d5c8107
don't change base url when a page is loaded by ajax
jguyomard c1b2f8d
now, a href works when an original base tag is defined in HTML
jguyomard 3917830
ajax even if target top
jguyomard f9e5cce
data-prefetch on link tag
jguyomard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -761,7 +761,7 @@ define( [ | |
} | ||
|
||
if ( base ) { | ||
base.set( fileUrl ); | ||
//base.set( fileUrl ); | ||
} | ||
|
||
//workaround to allow scripts to execute when included in page divs | ||
|
@@ -1140,7 +1140,7 @@ define( [ | |
var url = $( ele ).closest( ".ui-page" ).jqmData( "url" ), | ||
base = documentBase.hrefNoHash; | ||
|
||
if ( !url || !path.isPath( url ) ) { | ||
if ( !url || !path.isPath( url ) || || $.support.dynamicBaseTag ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like you've got a double |
||
url = base; | ||
} | ||
|
||
|
@@ -1294,7 +1294,7 @@ define( [ | |
} | ||
|
||
// Should we handle this link, or let the browser deal with it? | ||
var useDefaultUrlHandling = $link.is( "[rel='external']" ) || $link.is( ":jqmData(ajax='false')" ) || $link.is( "[target]" ), | ||
var useDefaultUrlHandling = $link.is( "[rel='external']" ) || $link.is( ":jqmData(ajax='false')" ) || ( $link.is( "[target]" ) && !$link.is( "[target='_top']" ) ), | ||
|
||
// Some embedded browsers, like the web view in Phone Gap, allow cross-domain XHR | ||
// requests if the document doing the request was loaded via the file:// protocol. | ||
|
@@ -1332,7 +1332,7 @@ define( [ | |
//prefetch pages when anchors with data-prefetch are encountered | ||
$( document ).delegate( ".ui-page", "pageshow.prefetch", function() { | ||
var urls = []; | ||
$( this ).find( "a:jqmData(prefetch)" ).each(function(){ | ||
$( this ).find( "a:jqmData(prefetch), link:jqmData(prefetch)" ).each(function(){ | ||
var $link = $(this), | ||
url = $link.attr( "href" ); | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the whole branch a no-op. If that's the intention maybe just remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not mistaken, that line is necessary to make sure that images within the page load properly. The problem here is that I think the base should be set to the fileUrl, or in the case where the page we just loaded contains a base tag, it should be set to that base tag path.