Paul Lam
Paul Lam

Reputation: 1819

Foundation.js not working on pages with hash URI

I've enabled accordion and form-abide, neither of them is doing anything when the page is in a hash URI. It works when I disable my client-side routing. I have $(document).foundation(); in the bottom of my <body> already.

Here's the page and the hash URI in question: http://ingrower.apps.quantisan.com/#/production/A3

If I not use the /#/ client-side routing, then things seem to work. Any idea how to fix this?

Upvotes: 2

Views: 95

Answers (2)

Paul Lam
Paul Lam

Reputation: 1819

I explicitly called $(document).foundation('reflow'); after each client-side page load. In particular, making use of ComponentDidUpdate ReactJs lifecycle. This works now.

Although loading foundation() for every DOM update is obviously an overkill. I'm hoping there'd be a more elegant solution out there...

Upvotes: 0

SteveEdson
SteveEdson

Reputation: 2495

Change <script src="js/app.js" type="text/javascript"></script> to be /js/app.js. The page is trying to load your relative javascript at /#/app.js which obviously doesn't exist.

Upvotes: 1

Related Questions