tailieunhanh - Developing Large Web Applications- P14
Developing Large Web Applications- P14:This book presents a number of techniques for applying established practices of good software engineering to web development—that is, development primarily using the disparate technologies of HTML, CSS, JavaScript, and server-side scripting languages. Whereas there are many books on how to use languages, how to use libraries, and how to approach software engineering, this is the first book to codify many of the techniques it presents. These techniques will make the components of your own web applications more reusable, maintainable, and reliable | false new function m i This method hooks up a view to its data source which is a model. this m i If the view has no predecessor view it must be first in the chain. if true function Called when a change in the model takes place. Render new options. var select Remove any existing select element not created by the view. if select select mltsel select select null Insert a new select only the first time the view is being managed. if select select select select mltsel name select change this true Insert the select element for the selection list into the DOM. if select if true else false An Example Chained Selection Lists 111 var o var options var count Start the options with the model s label for the selection list. 0 o new Option o options count Load the rest of the selection list remaining with the options. for var i 0 i count i o new Option options i .text options i .value o function e Handle changes in one of the selection lists by adjusting others. var select var option .value if option The selection list has been set back to its initial state selection lists beyond it in the chain must be reset as well. else if Use Ajax to get options for the next selection
đang nạp các trang xem trước