New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

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

This comment has been minimized.

Show comment
Hide comment
@jaspermdegroot

jaspermdegroot Feb 25, 2013

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.

Member

jaspermdegroot commented Feb 25, 2013

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 closed this in be22887 Feb 25, 2013

arschmitz added a commit that referenced this issue Mar 12, 2013

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)

arschmitz added a commit that referenced this issue Mar 12, 2013

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)

arschmitz added a commit that referenced this issue Mar 12, 2013

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment