Sammy.jsJavaScript開發(fā)框架
Sammy.js 是一個微型的 JavaScript 框架用來簡化 JavaScript 應用程序的編寫,其核心只有 16K,壓縮后 5.2K 大小。
示例代碼:
// initialize the application
var app = Sammy('#main', function() {
// include a plugin
this.use('Mustache');
// define a 'route'
this.get('#/', function() {
// load some data
this.load('posts.json')
// render a template
.renderEach('post.mustache')
// swap the DOM with the new content
.swap();
});
});
// start the application
app.run('#/');
評論
圖片
表情
