Backbone 学习1
<!DOCTYPE HTML> <html dir="ltr" lang="zh-CN"> <head> <meta charset="utf-8"> <title></title> <script type="text/javascript" src="lib/jquery.js"></script> <script type="text/javascript" src="lib/json2.js"></script> <script type="text/javascript" src="lib/underscore.js"></script> <script type="text/javascript" src="lib/backbone.js"></script> </head> <body> <div id="underscore_button">CLICK</div> <script type="text/javascript" src="js/demo.js"></script> <script type="text/javascript" src="js/us.js"></script> </body> </html>
(function($){ var ListView=Backbone.View.extend({ el:$("body"), initialize:function(){ _.bindAll(this,"render"); this.render(); }, render:function(){ $(this.el).append("<ul><li>Hello World</li></ul>"); } }) var listView=new ListView(); })(jQuery)
posted on 2013-06-08 09:55 Ijavascript 阅读(157) 评论(0) 编辑 收藏 举报