Google+ Share Places Autocomplete Google Maps Markers Web Components Custom Elements Shadow DOM Template Element Shadow DOM Slots, Composition Shadow DOM Styling Shadow DOM and Events Mutation Observer Selection and Range Event Loop: microtasks and macrotasksĬookies: okie LocalStorage, SessionStorage IndexedDB Page:DOMContentLoaded, load, beforeunload, unload Scripts: async, defer Resource Loading: onload and onerror Mouse Events Basics Moving the mouse: mouseover/out, mouseenter/leave Drag and Drop with JavaScript Keyboard: keydown and keyup Scrollingįorm Properties and Methods Focusing: focus/blur Events: change, input, cut, copy, paste Forms: event and method submit JavaScript Introduction to Browser Events Bubbling and Capturing Event Delegation Browser Default Actions Dispatching Custom Events Popups and Window Methods Cross-window CommunicationĪrrayBuffer, Binary Arrays TextDecoder and TextEncoder Blob File and FileReaderīrowser Environment, Specs Searching:getElement*, querySelector* Node Properties:Type, Tag and Contents Attributes and Properties Modifying the document Styles and Classes Window Sizes and Scrolling Coordinates Modules Export and Import Dynamic Imports Generators Async Iterators and Generators Introduction:callbacks Promise Promise Chaining Error Handling with Promises Promise API Promisification Microtasks Async/await Prototypal inheritance F.prototype Native Prototypes Prototype Methods, Objects WithoĬlass Basic Syntax Class inheritance Static properties and methods Private and Protected Properties Extending Built-in Classes Class Checking: “instanceof” MixinsĮrror handling, "try.catch" Custom Errors, Extending Error Property Flags and Descriptors Property Getters and Setters Recursion and Stack Rest Parameters and Spread Synta Variable scope The Old “var” Global Object Function object, NFE The “new function” Syntax setTimeout and setInterval Decorators and forwarding, call/apply Function Binding Arrow functions revisited Methods of primitives Numbers Math Strings Arrays Array methods Iterables Map and Set WeakMap and WeakSet Object.keys, Values, Entries Destructuring Assignment Date and time JSON methods, toJSON Objects Object methods, "this" Garbage collection Symbol Types Object to Primitive Conversion Constructor, operator "new" So who wins? Well, I favor 'keypress', since handling control characters usually gives me a headache.Introduction Start using Javascript Comments Javascript with DOM JavaScript Use Strict Variables Data Types Simple Actions Operators Comparison operators Logical Operators Conditional operators: if, '?' Switch Loops Functions Function Expressions Arrow Functions The only reason I can see for using 'keydown' or 'keyup' would be to track the 'shift', 'ctrl', 'alt', or other special control characters. If you use a foreign language keyboard, 'keypress' will return the correct ascii value, while 'keydown' and 'keyup' return nothing. The 'keypress' event returns a number which is the ascii number of the character. The 'which' values seem to stay consistent between the major browsers, so it may be a good ideato use 'which' over 'keycode' and 'charcode'. Oddly enough the results vary from one browser to the next, especially with 'keycode' and 'charcode', so be careful. This is all great, but what do you actually get out of these events?įrom the DOM, you can retrieve the 'keycode', 'key', 'charcode', 'char', and 'which' values related to the key event. It repeats while the user keeps the key depressed.įires when the user releases a key, after the default action of that key has been performed." It repeats while the user keeps the key depressed.įires when an actual character is being inserted in, for instance, a text input. It's one press, down and up again." But, Quirksmode says this about the key events:įires when the user depresses a key. If you're a little bit like me, you'll go: "What do you need three for? You press down on the key and you let go. JQuery has three event handlers for the keyboard keydown, keypress, and keyup.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |