Navigation: Prefetching pages from other directories offsets <base>-tag #5677

Closed
m90 opened this Issue Feb 22, 2013 · 1 comment

Projects

None yet

3 participants

@m90
m90 commented Feb 22, 2013

I have a page that is prefetching pages from another directory. When the prefetch is done the <base>-tag is altered pointing to the directory of the prefetched pages, breaking all other links on the page. Markup looks like:

<div data-role="page" class="type-home">

    <div data-role="content">
            <nav>
                <ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="b">
                <li data-role="list-divider">Overview</li>
                <li><a href="one.html" rel="external">One</a></li>
                <li><a href="two.html" rel="external">Two</a></li>
                <li><a href="three.html" rel="external">Three</a></li>
                <li><a href="four.html" rel="external">Four</a></li>
            </ul>
        </nav>
    </div>

    <div data-role="footer" data-id="tabbar" data-position="fixed">
        <div data-role="navbar" class="menu-navbar-custom">
            <ul>
                <li><a data-prefetch href="pages/one.html">Directory 1</a></li>
                <li><a data-prefetch href="pages/two.html">Directory 2</a></li>
                <li><a data-prefetch href="pages/three.html">Directory 3</a></li>
                <li><a data-prefetch href="pages/four.html">Directory 4</a></li>
                <li><a data-prefetch href="pages/five.html">Directory 5</a></li>
            </ul>
        </div>
    </div>

</div>

The links in the data-role"="content" part will now point to pages/one.html as the base tag is set to pages/. This occurs with a little lag as it seems to wait until the pages are actually fetched. Happened to me in 1.3.0 Beta, 1.3.0 RC1 and 1.3.0 Final.

Unfortunately I cannot produce a JSBIN / JSfiddle test case as a failing prefetch AJAX call will not kick off the process that messes with the <base> tag

@jaspermdegroot
Member

Here is an example of the issue: http://view.jquerymobile.com/1.3.0/docs/widgets/pages/

The "view multi-page template" button links to the wrong file because of the prefetch example on the same page.

@arschmitz arschmitz added a commit that closed this issue Feb 25, 2013
@arschmitz arschmitz loadPage: update to account for if the page is prefetched done update…
… basetag. Fixed #5677 - Navigation: Prefetching pages from other directories offsets <base>-tag
be22887
@arschmitz arschmitz closed this in be22887 Feb 25, 2013
@arschmitz arschmitz added a commit that referenced this issue Mar 12, 2013
@arschmitz @gabrielschulhof arschmitz + gabrielschulhof loadPage: update to account for if the page is prefetched done update…
… basetag. Fixed #5677 - Navigation: Prefetching pages from other directories offsets <base>-tag

(cherry picked from commit be22887)
c8a8046
@arschmitz arschmitz added a commit that referenced this issue Mar 12, 2013
@arschmitz @gabrielschulhof arschmitz + gabrielschulhof loadPage: update to account for if the page is prefetched done update…
… basetag. Fixed #5677 - Navigation: Prefetching pages from other directories offsets <base>-tag

(cherry picked from commit be22887)
8e75674
@arschmitz arschmitz added a commit that referenced this issue Mar 12, 2013
@arschmitz @gabrielschulhof arschmitz + gabrielschulhof loadPage: update to account for if the page is prefetched done update…
… basetag. Fixed #5677 - Navigation: Prefetching pages from other directories offsets <base>-tag

(cherry picked from commit be22887)

Conflicts:
	js/jquery.mobile.navigation.js
bb00a5b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment