JAVASCRIPT FOR BEGINNERS
THE ULTIMATE GUIDE TO UNDERSTAND JAVASCRIPT CODE AND ITS FUNDAMENTALS
BY JOHN BACH
st edition
2020
memlnc
Table of contents
Preface 1. Introduction to JavaScript
1.1. What is JavaScript
1.2. JavaScrip t versions
1.3. Client-side JavaScript
1.4. Other uses for JavaScr ipt
1.5. Learning JavaScript
Part I. JavaScript Basics
Lexical structure
2.1. Character set
2.2. Case Sensitivity
2.3. Separators and line feeds
2.4. Optional semicolons
2.5. Comments
2.6. Literals
2.7. Identifiers
2.8. Reserved words
Data types and values
3.1. Numbers
3.2. Lines
3.3. Boolean values
3.4. Functions
3.5. Objects you
3.6. Arrays
3.7. Value null
3.8. The value is undefined
3.9. Date object
3.10. Regular Expressions
3.11. Error Objects
3.12. Type conversion
3.13. Wrapper Objects for Elementary Data Types
Table of contents
3.14. Converting Objects to Elementary Types
3.15. By value or by reference
Variables
4.1. Variable typing
4.2. Declaring Variables
4.3. Variable Scope
4.4. Elementary and Reference Types
4.5. Garbage collection
4.6. Variables as Properties
4.7. More About Variable Scope 75
Expressions and Operators
5.1. Expressions
5.2. Operator overview
5.3. Arithmetic Operators
5.4. Equality Operators
5.5. Relational Operators
5.6. String Operators
5.7. Logical Operators
5.8. According to the bit operators
5.9. Assignment Operators
5.10. Other operators ry
Instructions
6.1. Expression Statements
6.2. Compound Instructions
6.3. Instructions if
6.4. Instruction else if
6.5. Switch statement
6.6. Ince truktsiya while
6.7. Cycle do / whil e
6.8. Instruction for
6.9. For / in instruction
6.10. Tags
6.11. Instruction break
6.12. The continue statement
6.13. Ying struction var
6.14. Instructions fu nction
6.15. Instructions return
6.16. Throw statement
6.17. Instructions try / catch / finally
6.18. Instruction with
6.19. Blank Instruction
Table of contents
nine
6.20. Summary table of JavaScript statements
Objects and Arrays
7.1. Creating Objects
7.2. Object Properties
7.3. Objects as Associative Arrays
7.4. Properties and Methods of the Object Generic Class
7.5. Arrays
7.6. Reading and writing elements of an array
7.7. Array Methods
7.8. Array-Like Objects
Functions
8.1. Defining and Calling Functions
8.2. Function Arguments
8.3. Functions as data
8.4. Functions as Methods
8.5. Constructor function
8.6. Properties and Methods of Functions
8.7. Practical Function Examples
8.8. Function Scope and Closures
8.9. Function () Constructor
Classes, Constructors, and Prototypes
9.1. Constructor y
9.2. Prototypes and Inheritance
9.3. Object-Oriented JavaScript
9.4. General Methods of the Object Class
9.5. Superclasses and Con ssy
9.6. Extending Without Inheritance
9.7. Determining the type of object
9.8. Example: auxiliary IU Todd defineClass ()
Modules and Namespaces
10.1. Creating Modules and Namespaces
10.2. Importing Symbols from Namespaces
10.3. Module with auxiliary functions
Patterns and Regular Expressions
11.1. Defining Regular Expressions
11.2. String class methods for pattern matching
11.3. RegExp Object
ten
Table of contents
Development of scripts for Java- applications
12.1. Embedding JavaScript
12.2. Interoperating with Java Code
Part II. Client-side JavaScript
JavaScript in Web Browsers
13.1. Web Browser Environment
13.2. Embedding JavaScript Code in HTML Documents
13.3. Event handlers in HTML
13.4. JavaScript in URL
13.5. Executing JavaScript Programs
13.6. Owls patibility on the client side
13.7. Availability
13.8. JavaScript Security
13.9. Other Realizations of JavaScript on the World Wide Web
Working with Browser Windows
14.1. Timers
14.2. L ocation and History Objects
14.3. Window , Screen, and Navigator Objects
14.4. Windowing Techniques
14.5. P Simple, dialog boxes
14.6. Straw ka state
14.7. Error handling
14.8. Working with Multiple Knives and Frames
14.9. Example: panel n aviation in frame
Working with documents
15.1. Dynamic Document Content
15.2. Document Object Properties
15.3. Early Simplified DOM: Collections
document objects 319
15.4. W3C DOM Object Model Overview
15.5. Bypassing Document
15.6. Finding Items in a Document
15.7. Modification of Document
15.8. Adding Content to a Document
15.9. Example: Creating a Table of Contents Dynamically
15.10. Retrieving Selected Text
15.11. IE DOM
Table of contents
eleven
CSS and DHTML
16.1. CSS overview
16.2. CSS for DHTML
16.3. Using Styles in Scripting
16.4. Computed Styles
16.5. CSS Classes
16.6. Style Sheets
Events and event handling
17.1. Basic handling of events
17.2. Advanced Event Handling in DOM Level
17.3. Internet Explorer Event Handling Model
17.4. Mouse events
17.5. keyboard events
17.6. On the Events onload
17.7. Artificial Events
Forms and elements of forms
18.1. Form object
18.2. Defining Form Elements
18.3. Scripts and Form Elements
18.4. Form verification example
of Cookies The and a mechanism for storing data on the client
19.1. Overview of cookies
19.2. Saving cookies
19.3. Reading Cookies
19.4. An example of working with cookies
19.5. Alternatives to cookies
19.6. Data Stored and Security
Working with the HTTP protocol
20.1. Using the XMLHttpRequest Object
20.2. Examples and utilities with XMLHttpR equest
20.3. Ajax and Dynamic Scripting
20.4. Interacting with the HTTP Protocol Using the < script > Tag
JavaScript and XML
21.1. Retrieving XML Documents
21.2. Manipulating XML Data with the DOM API
21.3. Transforming an XML Document with XSLT
21.4. Querying XML -documents using the X the Path -vyrazheny
Table of contents
21.5. Serializing XML Document
21.6. Expanding HTML -shablonov using XML -data. ... ...
21.7. XML and Web Services
21.8. E4X: EcmaScript for XML
Working with graphics on the client side
22.1. Working with finished images
22.2. Graphics and CSS
22.3. SVG - Scalable Vector Graphics
22.4. VML - Vector Markup Language
22.5. Creating Graphics with the < canvas > Tag
22.6. Create graphics tools s Flash
22.7. Creating Graphics with Java
Foreword
After exiting the printing of the book fourth edition JavaScript . Detailed handle duction "Document Object Model ( the Document Obj ect Model , the DOM ), representation amounts to the basis of an application programming interface ( the Application Pro gramming Interface , the API ) for the scripting language JavaScript , running on the client side has been implemented adequately, if not completely, in web browsers. This means that developers of web applications have at their disposal a universal API for working with the content of web pages on the client side and a mature language ( JavaScript 1.5), which remained stable over the following years.
Now interest in JavaScript is starting to grow again. Now developers Execu form a JavaScript to create scripts, working on the protocol the HTTP , control XML -data and even dynamically create image iso mapping in a web browser . Many programmers using JavaScript create great programs and are used quite sophisticated technology, the solution tion, such as FAULT Ia and namespaces. The fifth edition is completely revised from the perspective of the newly emerging technologies Ajax and We b 2.0.
Next page