【发布时间】:2013-11-10 11:28:13
【问题描述】:
您好,我创建了一个带有击倒、放大和 sammy 的水疗中心。
如果我现在点击如下链接:
#/page?s=About
它链接到 url.de/subdirectory/#/page?s=About 这是正确的,但控制台会触发以下错误: 获取 url.de/关于 404(未找到) 因为它应该是: url.de/subdirectory/关于
我的 sammy 代码是:
var app=$.sammy(function () {
// define prexecutes
// update parameters in appModel from request for all routes
this.before('', function() {
//setParameters(this);
});
// authenticate on any page except for login and logout routes
this.before({except: {path:/\/(login|logout|hp)/}}, function() {
});
// actual routes
// home
this.get('#/', function() {
appModel.page("home");
return false;
});
// content
this.get('#/page', function(eventContext) {
content(eventContext);
});
});
app.run('#/');
如何让 sammy 不忽略我的网站所在的子目录?
【问题讨论】:
标签: javascript knockout.js sammy.js amplifyjs