Trying to get the 2nd director example working, see https://github.com/flatiron/director#client-side
As-is, it is broken in several ways (I'm talking about the code in the README.md, not the code in this gist, which is working).
sections.find('data-route[' + route + ']').show();
jQuery's .find()
gets "the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element." -- in this instance we'd want to use .filter()
.
router.configure({
on: allroutes
});
No arguments are passed to allroutes
-- maybe this used to work? How would it be done now? I played around for a bit, and tried digging in the source, but couldn't figure it out.
For now, the closest thing I could come up with was using window.location.hash
.