The JavaScript pocket guide
JavaScript is an object-oriented scripting language that enables you to modify a document's structure, styling, and content in response to user actions. This handy pocket serves as both a quick introduction to the language and acts a valuable reference. It's packed with tips as well as Jav...
Otros Autores: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
[Place of publication not identified]
Peachpit Press
2010
|
Edición: | 1st edition |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009629110906719 |
Tabla de Contenidos:
- Cover
- Contents
- Introduction
- Why JavaScript Is Cool
- Who Should Read This Book
- What You Need to Follow Along
- What's in This Book
- What's Not in This Book
- Resources
- Writing JavaScript Code
- Case Sensitivity
- Comments
- Semicolons
- Whitespace and New Lines
- Reserved Words
- Balanced Brackets and Quotes
- Firebug
- Chapter 1: JavaScript Basics
- Expressions and Statements
- Variables and Data
- Values
- Comparison
- Truthiness and Falsiness
- Functions and Objects
- Objects
- Loops
- Control Flow
- if/if-else/else
- switch/case
- try/catch/finally
- throw
- break and continue
- Compound Expressions
- Boolean Operators
- Logical NOT: !
- Logical AND: &&
- Logical OR: ||
- Combining Boolean Operators
- Ternary Expressions
- Chapter 2: Numbers
- Basic Math
- Number Formats
- Constants and Functions
- The Math Object
- Even More Properties and Methods
- Generating Random Integers
- Conversion
- Number Precision
- Chapter 3: Strings
- Escape Characters
- Operators
- Properties
- Methods
- Changing Case: toUpperCase(), toLowerCase()
- Extracting Parts of a String
- charAt(x), charCodeAt(x)
- slice(x[, y])
- substr(x[, y])
- Converting Strings to Arrays: split([delimiter, limit])
- Search and Replace
- indexOf(substring[, start])
- lastIndexOf(substring[, start])
- search(regexp)
- match(regexp)
- replace(pattern, replacement)
- Helper Functions
- stringTrim()
- Global Functions
- escape(string), unescape(string)
- encodeURI(string), decodeURI(string)
- encodeURIComponent(string), decodeURIComponent(string)
- Chapter 4: Arrays
- Creating Arrays
- Properties
- Looping Over Arrays
- forEach(loopFunc)
- Methods
- Adding Items to Arrays
- concat(x[,y,z ...])
- push(x[,y,z ...])
- unshift(x[,y,z ...])
- Removing Items from Arrays
- pop()
- shift().
- Extracting Items from Arrays
- slice(x[,y])
- splice(start[, length, newValue ...])
- Ordering Arrays
- reverse()
- sort([func])
- Converting Arrays to Strings
- join([delimiter])
- toString()
- Chapter 5: Functions
- Creating Functions
- Declarations
- Expressions
- Self-invoking Functions
- Arguments
- Default Values for Arguments
- Objects as Arguments
- Return Values
- Functions as Methods
- Context Binding
- Closures
- Recursion
- Caching
- Memoization
- Chapter 6: Objects
- Basics
- Looping Over Properties
- Enumerable Properties
- Deleting Properties
- Constructor Functions
- Prototypes
- Changing Built-in Prototypes
- Adding Modern JavaScript to Older Browsers
- Prototypes for Custom Data Types
- How to Understand Constructor Functions and Prototypes
- Object-Oriented Patterns
- Namespacing
- Local References
- Chapter 7: The Global Object
- Global Variables
- Accidentally Creating Global Variables
- Global Functions
- Timers
- setTimeout(func, delay)
- setInterval(func, delay)
- clearInterval(id), clearTimeout(id)
- Chapter 8: Client-Side Scripting
- Script Tags
- Inline Scripts
- Remote Scripts
- Where to Include the Tag
- The Browser Problem
- Progressive Enhancement
- Handling Non-JavaScript Situations
- The Tag
- JavaScript-Specific CSS Classes
- Chapter 9: Browsers and Windows
- Properties
- Global Functions
- Dialog Boxes
- Manipulating Browser Windows
- The history Object
- The location Object
- Cookies
- Setting Cookies
- Reading Cookies
- Deleting Cookies
- The navigator Object
- Chapter 10: The DOM
- Nodes
- Node Collections
- Node Trees
- Node Properties
- nodeName
- nodeType
- nodeValue
- Walking the DOM
- Starting with document
- Managing Whitespace
- children
- Finding Nodes
- getElementById(domId)
- getElementsByTagName(name).
- getElementsByClassName(name)
- querySelector(selector)
- querySelectorAll(selector)
- Creating Nodes
- Using DOM Methods
- createElement(tagName)
- createTextNode(nodeValue)
- cloneNode(deep)
- Using innerHTML
- Using Document Fragments
- Adding, Removing, and Reordering Nodes
- appendChild(node)
- insertBefore(node, reference)
- removeChild(childNode)
- Utility Functions
- Inspecting and Changing Elements
- Attributes
- Calculated Attribute Values
- Special Properties
- Element Styles
- The class Attribute
- The style Attribute
- Computed Styles
- Chapter 11: Events
- Event Attributes
- Return Values
- Event Attribute Method Context
- Multiple Event Handlers
- Event Methods
- addEventListener(eventType, handler, capture)
- removeEventListener(eventType, handler, capture)
- The Event Object
- Properties
- Methods
- Event Bubbling and Capturing
- Bubbling
- Capturing
- Stop Propagation
- Event Delegation
- Event Examples
- Browser Events
- load
- unload
- beforeunload
- resize
- DOMContentLoaded
- Mouse Events
- click
- mousedown, mouseup
- dblclick
- mouseover, mouseout
- mouseenter, mouseleave
- Keyboard Events
- keydown
- keypress
- keyup
- Form Element Events
- change
- submit
- Other Events
- focus
- blur
- Chapter 12: Libraries
- Choosing a Library
- Using Libraries with This Book
- jQuery
- Coding with jQuery
- jQuery Objects
- jQuery Utilities
- jQuery UI
- YUI [(sub)3]
- Coding with YUI [(sub)3]
- YUI [(sub)3] Gallery
- MooTools
- Coding with MooTools
- Namespacing
- MooTools More
- Chapter 13: Image Slideshow
- Debugging Your Code
- Slideshow Ingredients
- Slideshow HTML
- Slideshow CSS
- Slideshow JavaScript
- Creating the Slideshow Images
- Centering the Images
- The Slideshow Code
- Slideshow Controls
- jQuery Glossary
- The jQuery Function: ().
- jQuery Object Methods
- Chapter 14: Drop-Down Menus
- Menu HTML
- Menu Markup
- Menu CSS
- Progressive Enhancement
- Menu JavaScript
- MooTools Constructor Functions
- Arrays in MooTools
- Event Handlers in MooTools Classes
- Showing and Hiding Submenus
- Clicking Outside the Menus
- Extending the Menu Class
- Overriding Inherited Methods
- Using MooTools Effects
- MooTools Glossary
- Element Utilities
- Element Methods
- Array Utilities
- Function Utilities
- Chapter 15: Ajax
- Ajax Considerations
- Servers
- Same-Origin Policy
- Data Formats
- User Experience
- Ajax Example
- Setup
- Data File
- Controller File
- Reading Data from the File
- Get the Page Number from the Query String
- Saving Form Data to the File
- Arrange the Data Just for the Page
- Send JSON for Ajax Requests
- Send an HTML Template for Normal Page Requests
- The HTML Template
- HTML Page Outline
- Data Table Markup
- Navigation Links
- Form Markup
- Checking Your Work
- Ajaxifying the Page
- Script Outline
- Overriding the Previous and Next Links
- Waiting for the Request to Load
- Error Handling
- Handling the Response
- Updating the User Interface
- Overriding the Form
- Getting Around the Same-Origin Policy
- Proxies
- JSON-P
- Chapter 16: Animation
- Simple Animation
- Time-Based Animation
- Easing
- Animation with Libraries
- YUI [(sub)3] Animation Objects
- The jQuery animate() Method
- Resetting Animation
- Using Animation
- Index.