... 103 events, 91–111 browsers, 91–94 custom, 108–111 Event#preventDefault, 99–101 Event#stop, 99–101 Event#stopPropagation, 99–101 and forms, 102–108 overview, 91–98 expanded state, 117 exponential decay, ... 167–169 ■H h2s, 61 handle element, 293 handle option, 260 hasClassName method, 117–119 ■INDEX320 clientWidth property, 198 code formatting, 311 code patterns, 297–305 inheritance and m...
Ngày tải lên: 03/07/2014, 01:20
... Here) 91 Pre-DOM, Part 1 91 Pre-DOM, Part 2 92 Events: The Crash Course 94 Using Event#stopPropagation, Event#preventDefault, and Event#stop 99 A Further Example 101 Events and Forms 102 Client-Side ... 159 Using Function#curry 159 Using Function#delay and Function#defer 161 Using Function#bind 164 Summary 165 ■CHAPTER 8 Other Helpful Things: Useful Methods on Built-Ins 167 Using S...
Ngày tải lên: 03/07/2014, 01:20
Practical prototype and scipt.aculo.us part 3 pot
... both for creating Prototype and for inviting me to be a part of Prototype Core. Other team members gave critical moral support: Thomas Fuchs, Tobie Langel, Mislav Marohnic, and Justin Palmer. Objects, ... KNOW ABOUT PROTOTYPE, JAVASCRIPT, AND THE DOM4 About the Technical Reviewer After getting hooked on the Web in 1996 and spending several years pushing pixels and bits for th...
Ngày tải lên: 03/07/2014, 01:20
Practical prototype and scipt.aculo.us part 7 potx
... code both smaller and easier to read. Prototype uses Object.extend all over the place internally: extending built-ins, “mixing in” interfaces, and merging default options with user-defined options. CHAPTER ... rel attribute. These are just some of the complex selectors you can use in $$. For more information on what’s possible, consult the Prototype API reference online ( http://pro...
Ngày tải lên: 03/07/2014, 01:20
Practical prototype and scipt.aculo.us part 8 potx
... we can also use that function as a litmus test to let us know whether an item matches our needle. The next four methods do just this. Using Enumerable#detect Enumerable#detect finds and returns ... NodeLists, and various other groups of items. Nearly all your scripts will do some form of iteration over an array. So why is iteration so bland in JavaScript? Prototype sports a robust lib...
Ngày tải lên: 03/07/2014, 01:20
Practical prototype and scipt.aculo.us part 11 pot
... class: Object.extend(EvenArray .prototype, Enumerable); Remember how Object.extend works—we’re taking each property on Enumerable and copying it onto EvenArray .prototype. And we’re done. No, really. ... with Object.extend. When using Prototype, you’ll find there is rarely a step three. Summary Playing with Enumerable methods is a good way to dip your toe into the Prototype pool. You’...
Ngày tải lên: 03/07/2014, 01:20
Practical prototype and scipt.aculo.us part 13 potx
... single client using it. Responsiveness is good, and periodic client-server communication is good—but these benefits will eventually clash with the practical constraints of bandwidth and processing ... run automatically, thereby saving the user the tedious task of manually reloading the page every time. Let’s try it. Reload index.html and run this command in the console: new Ajax.Peri...
Ngày tải lên: 03/07/2014, 01:20
Practical prototype and scipt.aculo.us part 16 pot
... we’re in PHP, though, we’ll use associative arrays. If you ’re using a different server-side language, don’t worry—JSON libraries exist for practically ev ery commonly used programming language. ... timestamp value by 600 and take the remainder. This will give us a value between 0 and 599. First, we grab the timestamp. All we’re looking for is a number from 0 to 600 (telling us where...
Ngày tải lên: 03/07/2014, 01:20
Practical prototype and scipt.aculo.us part 21 potx
... of words. Prototype establishes a bridge between the DOM and the commonest use cases of the typical developer. As a result, the code you write will be shorter and far more readable. Prototype s ... DOM 115 custom events from anywhere in your code; you can also listen for custom events with the same API that you’d use to listen for native browser events. The First Custom Event Prototyp...
Ngày tải lên: 03/07/2014, 01:20
Practical prototype and scipt.aculo.us part 27 potx
... andrew.throwPass(23); >> "Andrew Dupont throws for 23yds." andrew.passingYards; //-> 23 andrew.throwTouchdown(39); >> "Andrew Dupont throws ... "TOUCHDOWN!" andrew.passingYards; //-> 62 andrew.points; //-> 6 Everything works as expected. So let’s try another position. A wide receiver plays on offense and catches passes thrown ... { this.catchPas...
Ngày tải lên: 03/07/2014, 01:20