在使用Sammy.js和ASP.NET MVC3尝试一些示例时,我发现Sammy.js不支持重载的控制器方法调用。
请参考以下代码:
(function($) {
var app = $.sammy('#main', function() {
this.get('#/Home/Posts', function(context) {
context.log('Retrieve all posts');
});
this.get('#/Home/Posts/:id', function(context) {
context.log('Retrieve post by id');
});
});
$(function() {
app.run('#/');
});
})(jQuery);当我尝试在控制器中使用单个方法时(即没有重载,它工作得很好),但是在重载之后,方法sammy.js脚本没有响应。
有没有人有解决这个问题的办法?
发布于 2011-07-20 13:24:54
将第二个操作更改为
this.get('#/Home/Post/:id', function(context) {
context.log('Retrieve post by id');
});https://stackoverflow.com/questions/5700959
复制相似问题