【发布时间】:2013-04-14 05:26:48
【问题描述】:
我使用 Sammy.js 从路由中加载模板名称,但如果找不到该文件,我想将用户重定向到另一个页面。基本上,我有:
this.use(Sammy.Template, 'tpl');
this.get('#/:page', function() {
// render a template
// this.load()
this.render('templates/' + this.params['page'] + '.tpl').swap();
});
如何处理 404 错误?
【问题讨论】:
标签: javascript jquery http-status-code-404 sammy.js