Skip to content
This repository has been archived by the owner on Nov 24, 2020. It is now read-only.

JS prevents navigation of local files #28

Open
gubler opened this issue Aug 5, 2016 · 2 comments
Open

JS prevents navigation of local files #28

gubler opened this issue Aug 5, 2016 · 2 comments

Comments

@gubler
Copy link

gubler commented Aug 5, 2016

navigation.js prevents the browser from navigating normally if the AJAX request fails.

If a page is loaded from the file system (not through a server), the AJAX request generated on navigation fails due to CORS restrictions.

I think the problem is that line 297 is commented out:

return loading.show(
        promise
        .fail(function (e) {
            console.log(e); // eslint-disable-line no-console
            // location.href = relativeUrl;  <--- THIS LINE HERE
        })
    );

After the AJAX load fails and the error is logged to the console, the location is never updated and so the browser is never forwarded to the new page.

@yeluolei
Copy link

yeluolei commented May 9, 2017

same issue here, any idea for how to fix this problem?

@mikesamuel
Copy link

I had this problem as well. I managed to test the output of

gitbook build . gitbook_out

locally around by running

pushd gitbook_out && \
python -m SimpleHTTPServer 8000; \
popd

and browsing to http://127.0.0.1:8000/index.html.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants