Deep-linking with Sammy.js?

一曲冷凌霜 提交于 2019-12-24 10:41:08

问题


I recently built a website using the sammy.js framework. The site includes a portfolio page with a grid of thumbnails that link to the detail page for each portfolio piece. All of this works.

What I cannot seem to figure out how to do is be able to provide someone a link to a specific project on the site (ex: www.thesite.com/#/work-detail/some-project) and have it run the work-detail route with "some-project" as the variable that gets passed for it to load the correct content.

Any help would be appreciated.


回答1:


So, this doesn't work?

get('#/work-detail/:project', function() {
        alert(this.params['project']);
});


来源:https://stackoverflow.com/questions/6795019/deep-linking-with-sammy-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!