Annað
- Höfundur: Nicholas C. Zakas
- Útgáfa:3
- Útgáfudagur: 2012-01-03
- Hægt að prenta út 2 bls.
- Hægt að afrita 10 bls.
- Format:ePub
- ISBN 13: 9781118822166
- Print ISBN: 9781118026694
- ISBN 10: 1118822161
Efnisyfirlit
- Front Matter
- Dedication
- About the Author
- About the Technical Editor
- Credits
- Acknowledgments
- Foreword
- Introduction
- WHO THIS BOOK IS FOR
- What This Book Covers
- How This Book Is Structured
- What You Need to Use This Book
- Conventions
- Source Code
- Errata
- P2P.Wrox.com
- What's in This Chapter:
- A Short History
- JavaScript Implementations
- Figure 1-1
- ECMAScript
- ECMAScript Editions
- What Does ECMAScript Conformance Mean?
- ECMAScript Support in Web Browsers
- The Document Object Model (DOM)
- Figure 1-2
- Why the DOM Is Necessary
- DOM Levels
- Other DOMs
- DOM Support in Web Browsers
- The Browser Object Model (BOM)
- JavaScript Versions
- Summary
- What's in This Chapter:
- The <Script> Element
- Tag Placement
- Deferred Scripts
- Asynchronous Scripts
- Changes in XHTML
- Deprecated Syntax
- Inline Code Versus External Files
- Document Modes
- The <Noscript> Element
- Summary
- What's in This Chapter:
- Syntax
- Case-sensitivity
- Identifiers
- Comments
- Strict Mode
- Statements
- Keywords and Reserved Words
- Variables
- Data Types
- The typeof Operator
- The Undefined Type
- The Null Type
- The Boolean Type
- The Number Type
- Floating-Point Values
- Range of Values
- NaN
- Number Conversions
- The String Type
- Character Literals
- The Nature of Strings
- Converting to a String
- The Object Type
- Operators
- Unary Operators
- Increment/Decrement
- Unary Plus and Minus
- Bitwise Operators
- Figure 3-1
- Bitwise NOT
- Bitwise AND
- Bitwise OR
- Bitwise XOR
- Left Shift
- Figure 3-2
- Signed Right Shift
- Figure 3-3
- Unsigned Right Shift
- Boolean Operators
- Logical NOT
- Logical AND
- Logical OR
- Multiplicative Operators
- Multiply
- Divide
- Modulus
- Additive Operators
- Add
- Subtract
- Relational Operators
- Equality Operators
- Equal and Not Equal
- Identically Equal and Not Identically Equal
- Conditional Operator
- Assignment Operators
- Comma Operator
- Unary Operators
- Statements
- The if Statement
- The do-while Statement
- The while Statement
- The for Statement
- The for-in Statement
- Labeled Statements
- The break and continue Statements
- The with Statement
- The switch Statement
- Functions
- Understanding Arguments
- No Overloading
- Summary
- What's in This Chapter:
- Primitive and Reference Values
- Dynamic Properties
- Copying Values
- Figure 4-1
- Figure 4-2
- Argument Passing
- Determining Type
- Execution Context and Scope
- Figure 4-3
- Scope Chain Augmentation
- No Block-Level Scopes
- Variable Declaration
- Identifier Lookup
- Figure 4-4
- Mark-and-Sweep
- Reference Counting
- Performance
- Managing Memory
- What's in This Chapter:
- The Object Type
- The Array Type
- Detecting Arrays
- Conversion Methods
- Stack Methods
- Queue Methods
- Reordering Methods
- Manipulation Methods
- Location Methods
- Iterative Methods
- Reduction Methods
- The Date Type
- Inherited Methods
- Date-Formatting Methods
- Date/Time Component Methods
- The RegExp Type
- RegExp Instance Properties
- RegExp Instance Methods
- RegExp Constructor Properties
- Pattern Limitations
- The Function Type
- No Overloading (Revisited)
- Function Declarations versus Function Expressions
- Functions as Values
- Function Internals
- Function Properties and Methods
- Primitive Wrapper Types
- The Boolean Type
- The Number Type
- The String Type
- Character Methods
- String-Manipulation Methods
- String Location Methods
- The trim() Method
- String Case Methods
- String Pattern-Matching Methods
- The localeCompare() Method
- The fromCharCode() Method
- HTML Methods
- The Global Object
- URI-Encoding Methods
- The eval() Method
- Global Object Properties
- The Window Object
- The Math Object
- Math Object Properties
- The min() and max() Methods
- Rounding Methods
- The random() Method
- Other Methods
- What's in This Chapter:
- Understanding Objects
- Types of Properties
- Data Properties
- Accessor Properties
- Defining Multiple Properties
- Reading Property Attributes
- Types of Properties
- Object Creation
- The Factory Pattern
- The Constructor Pattern
- Constructors as Functions
- Problems with Constructors
- The Prototype Pattern
- How Prototypes Work
- Figure 6-1
- Figure 6-2
- Prototypes and the in Operator
- Alternate Prototype Syntax
- Dynamic Nature of Prototypes
- Figure 6-3
- Native Object Prototypes
- Problems with Prototypes
- How Prototypes Work
- Combination Constructor/Prototype Pattern
- Dynamic Prototype Pattern
- Parasitic Constructor Pattern
- Durable Constructor Pattern
- Inheritance
- Prototype Chaining
- Figure 6-4
- Default Prototypes
- Figure 6-5
- Prototype and Instance Relationships
- Working with Methods
- Problems with Prototype Chaining
- Constructor Stealing
- Passing Arguments
- Problems with Constructor Stealing
- Combination Inheritance
- Prototypal Inheritance
- Parasitic Inheritance
- Parasitic Combination Inheritance
- Figure 6-6
- Prototype Chaining
- What's in This Chapter:
- Recursion
- Closures
- Figure 7-1
- Figure 7-2
- Closures and Variables
- The this Object
- Memory Leaks
- Mimicking Block Scope
- Private Variables
- Static Private Variables
- The Module Pattern
- The Module-Augmentation Pattern
- Summary
- What's in This Chapter:
- The Window Object
- The Global Scope
- Window Relationships and Frames
- Figure 8-1
- Figure 8-2
- Window Position
- Window Size
- Navigating and Opening Windows
- Popping Up Windows
- Security Restrictions
- Pop-up Blockers
- Intervals and Timeouts
- System Dialogs
- Figure 8-3
- Figure 8-4
- Figure 8-5
- Figure 8-6
- Query String Arguments
- Manipulating the Location
- Detecting Plug-ins
- Registering Handlers
- What's in This Chapter:
- Capability Detection
- Safer Capability Detection
- Capability Detection Is Not Browser Detection
- Quirks Detection
- User-Agent Detection
- History
- Early Browsers
- Netscape Navigator 3 and Internet Explorer 3
- Netscape Communicator 4 and Internet Explorer 4–8
- Gecko
- WebKit
- Konqueror
- Chrome
- Opera
- iOS and Android
- Working with User-Agent Detection
- Identifying the Rendering Engine
- Identifying the Browser
- Identifying the Platform
- Identifying Windows Operating Systems
- Identifying Mobile Devices
- Identifying Game Systems
- The Complete Script
- Usage
- History
- Summary
- What's in This Chapter:
- Hierarchy of Nodes
- Figure 10-1
- The Node Type
- The nodeName and nodeValue Properties
- Node Relationships
- Figure 10-2
- Manipulating Nodes
- Other Methods
- The Document Type
- Document Children
- Document Information
- Locating Elements
- Special Collections
- DOM Conformance Detection
- Document Writing
- The Element Type
- HTML Elements
- Getting Attributes
- Setting Attributes
- The attributes Property
- Creating Elements
- Element Children
- The Text Type
- Creating Text Nodes
- Normalizing Text Nodes
- Splitting Text Nodes
- The Comment Type
- The CDATASection Type
- The DocumentType Type
- The DocumentFragment Type
- The Attr Type
- Working with the DOM
- Dynamic Scripts
- Dynamic Styles
- Manipulating Tables
- Using NodeLists
- Summary
- What's in This Chapter:
- Selectors API
- The querySelector() Method
- The querySelectorAll() Method
- The matchesSelector() Method
- Element Traversal
- HTML5
- Class-Related Additions
- The getElementsByClassName() Method
- The classList Property
- Focus Management
- Changes to HTMLDocument
- The readyState Property
- Compatibility Mode
- The head Property
- Class-Related Additions
- Character Set Properties
- Custom Data Attributes
- Markup Insertion
- The innerHTML Property
- The outerHTML Property
- The insertAdjacentHTML() Method
- Memory and Performance Issues
- The scrollIntoView() Method
- Document Mode
- The children Property
- The contains() Method
- Markup Insertion
- The innerText Property
- The outerText Property
- Scrolling
- What's in This Chapter:
- DOM Changes
- XML Namespaces
- Changes to Node
- Changes to Document
- Changes to Element
- Changes to NamedNodeMap
- Other Changes
- Changes to DocumentType
- Changes to Document
- Changes to Node
- Changes to Frames
- XML Namespaces
- Accessing Element Styles
- DOM Style Properties and Methods
- Computed Styles
- Working with Style Sheets
- CSS Rules
- Creating Rules
- Deleting Rules
- Element Dimensions
- Offset Dimensions
- Figure 12-1
- Client Dimensions
- Figure 12-2
- Scroll Dimensions
- Figure 12-3
- Determining Element Dimensions
- Offset Dimensions
- Figure 12-4
- Figure 12-5
- NodeIterator
- TreeWalker
- Ranges in the DOM
- Simple Selection in DOM Ranges
- Figure 12-6
- Complex Selection in DOM Ranges
- Figure 12-7
- Interacting with DOM Range Content
- Figure 12-8
- Inserting DOM Range Content
- Collapsing a DOM Range
- Figure 12-9
- Comparing DOM Ranges
- Figure 12-10
- Cloning DOM Ranges
- Clean Up
- Simple Selection in DOM Ranges
- Ranges in Internet Explorer 8 and Earlier
- Simple Selection in Internet Explorer Ranges
- Complex Selection in Internet Explorer Ranges
- Interacting with Internet Explorer Range Content
- Collapsing an Internet Explorer Range
- Comparing Internet Explorer Ranges
- Cloning an Internet Explorer Range
- What's in This Chapter:
- Event Flow
- Event Bubbling
- Figure 13-1
- Event Capturing
- Figure 13-2
- DOM Event Flow
- Figure 13-3
- Event Bubbling
- HTML Event Handlers
- DOM Level 0 Event Handlers
- DOM Level 2 Event Handlers
- Internet Explorer Event Handlers
- Cross-Browser Event Handlers
- The DOM Event Object
- The Internet Explorer Event Object
- The Cross-Browser Event Object
- UI Events
- The load Event
- The unload Event
- The resize Event
- The scroll Event
- Focus Events
- Mouse and Wheel Events
- Client Coordinates
- Figure 13-4
- Page Coordinates
- Screen Coordinates
- Figure 13-5
- Modifier Keys
- Related Elements
- Buttons
- Additional Event Information
- The mousewheel Event
- Figure 13-6
- Figure 13-7
- Touch Device Support
- Accessibility Issues
- Client Coordinates
- Keyboard and Text Events
- Key Codes
- Character Codes
- DOM Level 3 Changes
- The textInput Event
- Keyboard Events on Devices
- Figure 13-8
- Node Removal
- Node Insertion
- The contextmenu Event
- The beforeunload Event
- Figure 13-9
- The DOMContentLoaded Event
- The readystatechange Event
- The pageshow and pagehide Events
- The hashchange Event
- The orientationchange Event
- Figure 13-10
- The MozOrientation Event
- The deviceorientation Event
- Figure 13-11
- Figure 13-12
- The devicemotion Event
- Touch Events
- Gesture Events
- Event Delegation
- Removing Event Handlers
- DOM Event Simulation
- Simulating Mouse Events
- Simulating Keyboard Events
- Simulating Other Events
- Custom DOM Events
- Internet Explorer Event Simulation
- What's in This Chapter:
- Form Basics
- Submitting Forms
- Resetting Forms
- Form Fields
- Common Form-Field Properties
- Common Form-Field Methods
- Common Form-Field Events
- Text Selection
- The select Event
- Retrieving Selected Text
- Partial Text Selection
- Input Filtering
- Blocking Characters
- Dealing with the Clipboard
- Automatic Tab Forward
- HTML5 Constraint Validation API
- Required Fields
- Alternate Input Types
- Numeric Ranges
- Input Patterns
- Checking Validity
- Disabling Validation
- Options Selection
- Adding Options
- Moving and Reordering Options
- Using contenteditable
- Interacting with Rich Text
- Rich Text Selections
- Rich Text in Forms
- What's in This Chapter:
- Basic Usage
- THE 2D Context
- Fills and Strokes
- Drawing Rectangles
- Figure 15-1
- Figure 15-2
- Figure 15-3
- Drawing Paths
- Figure 15-4
- Drawing Text
- Figure 15-5
- Figure 15-6
- Figure 15-7
- Transformations
- Figure 15-8
- Drawing Images
- Figure 15-9
- Shadows
- Figure 15-10
- Gradients
- Figure 15-11
- Figure 15-12
- Patterns
- Figure 15-13
- Working with Image Data
- Compositing
- WebGL
- Typed Arrays
- Views
- Figure 15-14
- Typed Views
- Views
- The WebGL Context
- Constants
- Method Naming
- Getting Ready to Draw
- Viewports and Coordinates
- Figure 15-15
- Figure 15-16
- Buffers
- Errors
- Shaders
- Writing Shaders
- Creating Shader Programs
- Passing Values to Shaders
- Debugging Shaders and Programs
- Drawing
- Figure 15-17
- Figure 15-18
- Textures
- Reading Pixels
- Support
- Typed Arrays
- Summary
- What's in This Chapter:
- Cross-Document Messaging
- Native Drag and Drop
- Drag-and-Drop Events
- Custom Drop Targets
- The dataTransfer Object
- dropEffect and effectAllowed
- Draggability
- Additional Members
- Media Elements
- Properties
- Events
- Custom Media Players
- Codec Support Detection
- The Audio Type
- History State Management
- Summary
- What's in This Chapter:
- Browser Error Reporting
- Internet Explorer
- Figure 17-1
- Figure 17-2
- Figure 17-3
- Firefox
- Figure 17-4
- Figure 17-5
- Safari
- Figure 17-6
- Figure 17-7
- Opera
- Figure 17-8
- Figure 17-9
- Chrome
- Figure 17-10
- Figure 17-11
- Internet Explorer
- The try-catch Statement
- The finally Clause
- Error Types
- Usage of try-catch
- Throwing Errors
- When to Throw Errors
- Throwing Errors versus try-catch
- The error Event
- Error-Handling Strategies
- Identify Where Errors Might Occur
- Type Coercion Errors
- Data Type Errors
- Communication Errors
- Distinguishing between Fatal and Nonfatal Errors
- Log Errors to the Server
- Logging Messages to a Console
- Logging Messages to the Page
- Throwing Errors
- Operation Aborted
- Invalid Character
- Member Not Found
- Unknown Runtime Error
- Syntax Error
- The System Cannot Locate the Resource Specified
- What's in This Chapter:
- XML DOM Support in Browsers
- DOM Level 2 Core
- The DOMParser Type
- The XMLSerializer Type
- XML in Internet Explorer 8 and Earlier
- Serializing XML
- Loading XML Files
- Cross-Browser XML Processing
- XPath Support in Browsers
- DOM Level 3 XPath
- Single Node Results
- Simple Type Results
- Default Type Results
- Namespace Support
- XPath in Internet Explorer
- Namespace Support in Internet Explorer
- Cross-Browser XPath
- DOM Level 3 XPath
- XSLT Support in Browsers
- XSLT in Internet Explorer
- Simple XSLT Transformations
- Complex XSLT Transformations
- The XSLTProcessor Type
- Using Parameters
- Resetting the Processor
- Cross-Browser XSLT
- XSLT in Internet Explorer
- Summary
- What's in This Chapter:
- E4X Types
- The XML Type
- The XMLList Type
- The Namespace Type
- The QName Type
- General Usage
- Accessing Attributes
- Other Node Types
- Querying
- XML Construction and Manipulation
- Parsing and Serialization Options
- Namespaces
- Other Changes
- Enabling Full E4X
- Summary
- What's in This Chapter:
- Syntax
- Simple Values
- Objects
- Arrays
- Parsing and Serialization
- The JSON Object
- Serialization Options
- Filtering Results
- String Indentation
- The toJSON() Method
- Parsing Options
- Summary
- What's in This Chapter:
- The XMLHttpRequest Object
- XHR Usage
- HTTP Headers
- GET Requests
- POST Requests
- XMLHttpRequest LEVEL 2
- The FormData Type
- Timeouts
- The overrideMimeType() Method
- Progress Events
- The load Event
- The progress Event
- Cross-Origin Resource Sharing
- CORS in Internet Explorer
- CORS in Other Browsers
- Preflighted Requests
- Credentialed Requests
- Cross-Browser CORS
- Alternate Cross-Domain Techniques
- Image Pings
- JSONP
- Comet
- Figure 21-1
- Figure 21-2
- Server-Sent Events
- The API
- The Event Stream
- Web Sockets
- The API
- Sending/Receiving Data
- Other Events
- SSE versus Web Sockets
- Image Pings
- Security
- Summary
- What's in This Chapter:
- Advanced Functions
- Safe Type Detection
- Scope-Safe Constructors
- Lazy Loading Functions
- Function Binding
- Function Currying
- Tamper-Proof Objects
- Nonextensible Objects
- Sealed Objects
- Frozen Objects
- Advanced Timers
- Figure 22-1
- Figure 22-2
- Repeating Timers
- Figure 22-3
- Yielding Processes
- Function Throttling
- Custom Events
- Drag and Drop
- Fixing Drag Functionality
- Figure 22-4
- Figure 22-5
- Adding Custom Events
- Fixing Drag Functionality
- Summary
- What's in This Chapter:
- Offline Detection
- Application Cache
- Data Storage
- Cookies
- Restrictions
- Cookie Parts
- Cookies in JavaScript
- Subcookies
- Cookie Considerations
- Internet Explorer User Data
- Web Storage
- The Storage Type
- The sessionStorage Object
- The globalStorage Object
- The localStorage Object
- The storage Event
- Limits and Restrictions
- IndexedDB
- Databases
- Object Stores
- Transactions
- Querying with Cursors
- Key Ranges
- Setting Cursor Direction
- Indexes
- Concurrency Issues
- Limits and Restrictions
- Cookies
- What's in This Chapter:
- Maintainability
- What Is Maintainable Code?
- Code Conventions
- Readability
- Variable and Function Naming
- Variable Type Transparency
- Loose Coupling
- Decouple HTML/JavaScript
- Decouple CSS/JavaScript
- Decouple Application Logic/Event Handlers
- Programming Practices
- Respect Object Ownership
- Avoid Globals
- Avoid Null Comparisons
- Use Constants
- Be Scope-Aware
- Avoid Global Lookups
- Avoid the with Statement
- Choose the Right Approach
- Avoid Unnecessary Property Lookup
- Optimize Loops
- Unrolling Loops
- Avoid Double Interpretation
- Other Performance Considerations
- Minimize Statement Count
- Multiple Variable Declarations
- Insert Iterative Values
- Use Array and Object Literals
- Optimize DOM Interactions
- Minimize Live Updates
- Use innerHTML
- Use Event Delegation
- Beware of HTMLCollections
- Build Process
- Validation
- Compression
- File Compression
- HTTP Compression
- What's in This Chapter:
- requestAnimationFrame()
- Early Animation Loops
- Problems with Intervals
- mozRequestAnimationFrame
- webkitRequestAnimationFrame and msRequestAnimationFrame
- Page Visibility API
- Geolocation API
- Figure 25-1
- File API
- The FileReader Type
- Partial Reads
- Object URLs
- Drag-and-Drop File Reading
- File Upload with XHR
- Web Timing
- Web Workers
- Using a Worker
- Worker Global Scope
- Including Other Scripts
- The Future of Web Workers
- Summary
- A ECMAScript Harmony
- General Changes
- Constants
- Block-Level and Other Scopes
- Functions
- Rest and Spread Arguments
- Default Argument Values
- Generators
- Arrays and Other Structures
- Iterators
- Array Comprehensions
- Destructuring Assignments
- New Object Types
- Proxy Objects
- Proxy Functions
- Map and Set
- WeakMap
- StructType
- ArrayType
- Classes
- Private Members
- Getters/Setters
- Inheritance
- Modules
- External Modules
- General Changes
- Opting-In
- Variables
- Objects
- Functions
- Eval()
- Eval and Arguments
- Coercion of This
- Other Changes
- General Libraries
- Yahoo! User Interface Library (YUI)
- Prototype
- The Dojo Toolkit
- MooTools
- jQuery
- MochiKit
- Underscore.js
- Internet Applications
- Backbone.js
- Rico
- qooxdoo
- Animation and Effects
- script.aculo.us
- moo.fx
- Lightbox
- Cryptography
- JavaScript MD5
- JavaScrypt
- Validators
- JSLint
- JSHint
- JavaScript Lint
- Minifiers
- JSMin
- Dojo ShrinkSafe
- YUI Compressor
- Unit Testing
- JsUnit
- YUI Test
- Dojo Object Harness (DOH)
- qUnit
- Documentation Generators
- JsDoc Toolkit
- YUI Doc
- AjaxDoc
- Secure Execution Environments
- ADsafe
- Caja
UM RAFBÆKUR Á HEIMKAUP.IS
Bókahillan þín er þitt svæði og þar eru bækurnar þínar geymdar. Þú kemst í bókahilluna þína hvar og hvenær sem er í tölvu eða snjalltæki. Einfalt og þægilegt!Rafbók til eignar
Rafbók til eignar þarf að hlaða niður á þau tæki sem þú vilt nota innan eins árs frá því bókin er keypt.
Þú kemst í bækurnar hvar sem er
Þú getur nálgast allar raf(skóla)bækurnar þínar á einu augabragði, hvar og hvenær sem er í bókahillunni þinni. Engin taska, enginn kyndill og ekkert vesen (hvað þá yfirvigt).
Auðvelt að fletta og leita
Þú getur flakkað milli síðna og kafla eins og þér hentar best og farið beint í ákveðna kafla úr efnisyfirlitinu. Í leitinni finnur þú orð, kafla eða síður í einum smelli.
Glósur og yfirstrikanir
Þú getur auðkennt textabrot með mismunandi litum og skrifað glósur að vild í rafbókina. Þú getur jafnvel séð glósur og yfirstrikanir hjá bekkjarsystkinum og kennara ef þeir leyfa það. Allt á einum stað.
Hvað viltu sjá? / Þú ræður hvernig síðan lítur út
Þú lagar síðuna að þínum þörfum. Stækkaðu eða minnkaðu myndir og texta með multi-level zoom til að sjá síðuna eins og þér hentar best í þínu námi.
Fleiri góðir kostir
- Þú getur prentað síður úr bókinni (innan þeirra marka sem útgefandinn setur)
- Möguleiki á tengingu við annað stafrænt og gagnvirkt efni, svo sem myndbönd eða spurningar úr efninu
- Auðvelt að afrita og líma efni/texta fyrir t.d. heimaverkefni eða ritgerðir
- Styður tækni sem hjálpar nemendum með sjón- eða heyrnarskerðingu
- Gerð : 208
- Höfundur : 12514
- Útgáfuár : 2012
- Leyfi : 379