I recently started using knockout.js and sammy.js to modernize my app. However I got stuck with some problems.
I have some valid links on the page - users should actually navigate to that location, instead of imitating navigation behaviors using sammy.js
. I want only hash-based links to be routed by sammy.js, but it also intercepts links that does not contain any hashes.
for example, it intercepts <a href="/logout">logout</a>
.
the js part that does routing is :
Sammy(function () {
this.get('#/', function () {
...
});
this.get('#:id', function () {
...
});
this.get('', function () { this.app.runRoute('get', '#/') });
}).run();
I think this.get('' .. )
part is the culprit that invokes this behavior - I got it from knockout.js tutorial, which says that the line is necessary to allow users from other origins to properly browse my web page. the page that is ran by knockout.js code is /w/
. I want sammy.js to work only in /w/
or, at least allow users to navigate to /logout
. How can I accomplish this?