... Hash or the shorthand $H: var airportCodes = new Hash(); To set and retrieve keys from the hash, use Hash#set and Hash#get, respectively: airportCodes.set('AUS', 'Austin-Bergstrom ... shortcut, and we’ve got a syntax that’s almost as terse as the one we started with: var airportCodes = $H({ AUS: "Austin-Bergstrom Int'l", HOU: "Houston/Hobby", IAH:...
Ngày tải lên: 03/07/2014, 01:20
... atop Prototype. Most famously, script .aculo. us (which we’ll cover in Part 2) uses Prototype as a basis for a rich library of effects and UI controls. Many JavaScript toolkits, script .aculo. us included, ... to read and understand. These days, Prototype enjoys exhaustive documentation, both official and unofficial. But readability, intuitive naming schemes, and cleanlines...
Ngày tải lên: 03/07/2014, 01:20
Practical prototype and scipt.aculo.us part 9 ppsx
... map, inject, invoke, and pluck The next four Enumerable methods carry more cryptic names, but are every bit as useful as the methods described previously. Using Enumerable#map and Enumerable#inject The ... 4, 5, 6, 7, 8, 9, 10] .partition(isEven); //-> [ [2, 4, 6, 8, 10] , [1, 3, 5, 7, 9] ] Sorting Collections: min, max, and sortBy The next three Enumerable methods—min, max, and...
Ngày tải lên: 03/07/2014, 01:20
Practical prototype and scipt.aculo.us part 17 pps
... code into Firebug because you’re just starting out—as you learn about other aspects of Prototype, we’ll mix them in with what you already know, thus pushing the examples closer and closer to real-world ... page in 30 seconds and some of the scor es will increment and will continue to increment until that minute hand hits another multiple of 10, at which time the scores will all go back...
Ngày tải lên: 03/07/2014, 01:20
Practical prototype and scipt.aculo.us part 20 ppsx
... because the user hasn’t had a chance to enter text. But we know it’s definitely invalid if the text box receives focus, then loses focus, and is still empty. That’s when we should alert the user. There’s ... naturally, if it were a pipe dream. Prototype introduced support for custom events in version 1.6. Using Prototype, you can fire CHAPTER 5 ■ EVENTS108 Figure 5 -10. Only the second t...
Ngày tải lên: 03/07/2014, 01:20
Practical prototype and scipt.aculo.us part 14 pps
... class="number"> td.previous(); //-> null td.down(); //-> null Calls to up and next return the parent node and the next sibling, respectively. Calls to down and previous return null because no element ... 133 This time, we get results in all four directions: next and previous point to table rows 1 and 3, while up and down point to the parent node and the first...
Ngày tải lên: 03/07/2014, 01:20
Practical prototype and scipt.aculo.us part 34 ppsx
... 25px; padding: 10px; border: 5px solid #aaa; } Figure 9-5. The visual result of the given markup and CSS CHAPTER 9 ■ WHAT YOU SHOULD KNOW ABOUT DHTML AND SCRIPT .ACULO. US 197 script .aculo. us PART 2 Inline ... (drag- and- drop), and new controls (sliders, combo boxes, and in-place editors). DHTML isn’t a special language; it’s just a term for what becomes possible when the DO...
Ngày tải lên: 03/07/2014, 01:20
Practical prototype and scipt.aculo.us part 42 ppsx
... a new file called game.html with script tags pointing to prototype. js and scriptaculous.js: CHAPTER 10 ■ INTRODUCTION TO SCRIPT .ACULO. US EFFECTS244 Queues Effect queues address a subset of the ... visible—it’s only just begun animating. That’s because the interpreter doesn’t wait around; it schedules the frames of the animation, and then moves on to the next line. script .aculo....
Ngày tải lên: 03/07/2014, 01:20
Practical prototype and scipt.aculo.us part 48 ppsx
... IN-PLACE EDITORS, AND SLIDERS280 • Click a suggestion. • Use the up/down arrow keys to highlight a suggestion, and then press Enter. • Use the up/down arrow keys to highlight a suggestion, and then press ... done. When a user recognizes our list as a drop-down menu, he’ll expect it to act like one. For the user’s sake, Autocompleter tries very hard to ape the behavior of a drop-down....
Ngày tải lên: 03/07/2014, 01:20
Practical prototype and scipt.aculo.us part 55 pps
... 13–14, 51, 129, 210, 244 script .aculo. us contributing to, 209 loading on page, 210 212 overview, 208– 210 similarities to Prototype, 208–209 web site, 209 scriptaculous.js file, 210 212, 244 Scripts, ... script .aculo. us, 208–209 testing, 14–16 web site, 11 Prototype object, 15 prototype property, 5, 20, 142 Prototype. emptyFunction function, 313 prototype. js file, 13–14, 51, 8...
Ngày tải lên: 03/07/2014, 01:20