摘要: 1. Ceate a route Class var AppRouter = Backbone.Router.extend({ }); 2. Add a route name it "show", listene to 'appointments/:id' var AppRouter = Backb 阅读全文
posted @ 2014-08-07 14:04 Zhentiw 阅读(192) 评论(0) 推荐(0)
摘要: First, memory is set aside for all necessary variables and declared functions. Function expression never got hosited in Javascirpt. Therefore, you can 阅读全文
posted @ 2014-08-05 16:21 Zhentiw 阅读(297) 评论(0) 推荐(0)
摘要: They’ve got a problem with their existing code, which tries to use a closure. Check it out: function assignLaser( shark, sharkList ){ var stationAssig 阅读全文
posted @ 2014-08-04 20:57 Zhentiw 阅读(244) 评论(0) 推荐(0)
摘要: function buildCoveTicketMarker(transport){ var passengerNumber = 0; return function(name){ passengerNumber++; alert("Ticket via the " +transport+ "Wel 阅读全文
posted @ 2014-08-04 20:15 Zhentiw 阅读(156) 评论(0) 推荐(0)
摘要: Returning a function from a function, complete with variables from an external scope, is called a closure. The entire contents of one of these inner f 阅读全文
posted @ 2014-08-04 18:33 Zhentiw 阅读(475) 评论(0) 推荐(0)
摘要: It's finally time to start building out our Appointment app. We're going to be using a collection and a collection view to display a list of appointme 阅读全文
posted @ 2014-08-04 05:13 Zhentiw 阅读(227) 评论(0) 推荐(0)
摘要: Define a collection: var AppointmentList = Backbone.Collection.extend({model: Appointment}); RESET the json: var appointments = new AppointmentList(); 阅读全文
posted @ 2014-08-02 21:28 Zhentiw 阅读(155) 评论(0) 推荐(0)
摘要: The Poplar Puzzle-makers weren’t too impressed. They barely noticed your simple and beautiful array of functions, and were only sort of “meh” on the u 阅读全文
posted @ 2014-08-02 20:52 Zhentiw 阅读(234) 评论(0) 推荐(0)
摘要: Now the people at Poplar Puzzles would like you to treat an array of functions like a Queue, passing the result of each function into the next until t 阅读全文
posted @ 2014-08-02 20:29 Zhentiw 阅读(160) 评论(0) 推荐(0)
摘要: var parkRides = [["Birch Bumpers", 40], ["Pines Plunge", 55], ["Cedar Coaster", 20], ["Ferris Wheel of Firs". 90]]; var fastPassQueus = ["Cedar Coaste 阅读全文
posted @ 2014-08-02 19:50 Zhentiw 阅读(219) 评论(0) 推荐(0)