12.07.2015 Views

Pro JavaScript for Web Apps pdf - EBook Free Download

Pro JavaScript for Web Apps pdf - EBook Free Download

Pro JavaScript for Web Apps pdf - EBook Free Download

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 4 USING URL ROUTINGThe selected item is: I have defined another custom binding to correctly set the selected attribute on the appropriateoption element. I called this binding selected (obviously enough), and it is defined, as shown in Listing4-11, in the utils.js file.Listing 4-11. The Selected Data Bindingko.bindingHandlers.selected = {init: function(element, accessor) {if (accessor()) {$(element).siblings("[selected]").removeAttr("selected");$(element).attr("selected", "selected");}},update: function(element, accessor) {93www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!