Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

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

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

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

m90 opened this issue Feb 22, 2013 · 1 comment

Comments

@m90
Copy link

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
Copy link
Contributor

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 added a commit that referenced this issue Mar 12, 2013
… basetag. Fixed #5677 - Navigation: Prefetching pages from other directories offsets <base>-tag

(cherry picked from commit be22887)
arschmitz added a commit that referenced this issue Mar 12, 2013
… basetag. Fixed #5677 - Navigation: Prefetching pages from other directories offsets <base>-tag

(cherry picked from commit be22887)
arschmitz added a commit that referenced this issue Mar 12, 2013
… basetag. Fixed #5677 - Navigation: Prefetching pages from other directories offsets <base>-tag

(cherry picked from commit be22887)

Conflicts:
	js/jquery.mobile.navigation.js
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants