Atnaujinkite slapukų nuostatas

El. knyga: Beginning JavaScript, 5e 5th Edition [Wiley Online]

  • Formatas: 768 pages
  • Išleidimo metai: 24-Apr-2015
  • Leidėjas: Wrox Press
  • ISBN-10: 1119209420
  • ISBN-13: 9781119209423
Kitos knygos pagal šią temą:
  • Wiley Online
  • Kaina: 47,57 €*
  • * this price gives unlimited concurrent access for unlimited time
  • Formatas: 768 pages
  • Išleidimo metai: 24-Apr-2015
  • Leidėjas: Wrox Press
  • ISBN-10: 1119209420
  • ISBN-13: 9781119209423
Kitos knygos pagal šią temą:
The bestselling JavaScript guide, updated with current features and best practices

Beginning JavaScript 5th Edition shows you how to work effectively with JavaScript frameworks, functions, and modern browsers, and teaches more effective coding practices using HTML5. This new edition has been extensively updated to reflect the way JavaScript is most commonly used today, introducing you to the latest tools and techniques available to JavaScript developers. Coverage includes modern coding practices using HTML5 markup, the JSON data format, DOM APIs, the jQuery framework, and more. Exercises with solutions provide plenty of opportunity to practice, and the companion website offers downloadable code for all examples given in the book.

  • Learn JavaScript using the most up to date coding style
  • Understand JSON, functions, events, and feature detection
  • Utilize the new HTML5 elements and the related API
  • Explore new features including geolocation, local storage, and more

JavaScript has shaped the Web from a passive medium into one that is rich, dynamic, and interactive. No matter the technology on the server side, it's JavaScript that makes it come alive in the browser. To learn JavaScript the way it's used today,Beginning JavaScript, 5th Edition is your concise guide.

Introduction xix
Chapter 1 Introduction To Javascript And The Web 1(16)
Introduction to JavaScript
1(6)
What Is JavaScript?
2(1)
JavaScript and the Web
3(1)
What Can JavaScript Do for Me?
4(1)
Tools Needed to Create JavaScript Web Applications
4(3)
Development Tools
4(1)
Web Browsers
5(2)
Where Do My Scripts Go?
7(2)
Linking to an External JavaScript File
7(1)
Advantages of Using an External File
8(1)
Your First Simple JavaScript Program
9(1)
Writing More JavaScript
10(5)
A Brief Look at Browsers and Compatibility Problems
15(1)
Summary
16(1)
Chapter 2 Data Types And Variables 17(38)
Types of Data in JavaScript
18(2)
Numerical Data
18(1)
Text Data
19(1)
Boolean Data
20(1)
Variables-Storing Data in Memory
20(6)
Creating Variables and Giving Them Values
22(2)
Assigning Variables with the Value of Other Variables
24(2)
Using Data-Calculations and Basic String Manipulation
26(12)
Numerical Calculations
26(4)
Increment and Decrement Operators
29(1)
Operator Precedence
30(5)
Basic String Operations
35(2)
Mixing Numbers and Strings
37(1)
Data Type Conversion
38(5)
Dealing with Strings That Won't Convert
41(2)
Arrays
43(9)
A Multi-Dimensional Array
47(5)
Summary
52(3)
Chapter 3 Decisions And Loops 55(32)
Decision Making-The if and switch Statements
56(20)
Comparison Operators
56(2)
Precedence
57(1)
Assignment versus Comparison
57(1)
Assigning the Results of Comparisons
58(1)
The if Statement
58(4)
Logical Operators
62(3)
AND
63(1)
OR
64(1)
NOT
64(1)
Multiple Conditions Inside an if Statement
65(4)
else and else if
69(1)
Comparing Strings
70(1)
The switch Statement
71(5)
Executing the Same Code for Different Cases
75(1)
Looping-The for and while Statements
76(8)
The for Loop
76(4)
The for...in Loop
80(1)
The while Loop
80(2)
The do...while loop
82(1)
The break and continue Statements
83(1)
Summary
84(3)
Chapter 4 Functions And Scope 87(12)
Creating Your Own Functions
88(4)
Scope and Lifetime
92(2)
Global Scope
92(1)
Functional Scope
93(1)
Identifier Lookup
93(1)
Functions as Values
94(3)
Summary
97(2)
Chapter 5 JavaScript-an Object-Based Language 99(54)
Object-Based Programming
100(5)
What Are Objects?
100(1)
Objects in JavaScript
100(1)
Using JavaScript Objects
101(3)
Creating an Object
102(1)
Using an Object's Properties
103(1)
Calling an Object's Methods
104(1)
Primitives and Objects
104(1)
JavaScript's Native Object Types
105(39)
String Objects
105(11)
The length Property
106(1)
Finding a String Inside Another String-The indexOf() and lastIndex0f0 Methods
106(3)
Copying Part of a String-The substr() and substring() Methods
109(1)
Converting Case-The toLowerCase() and toUpperCase() Methods
110(1)
Selecting a Single Character from a String-The charAt() and charCodeAt() Methods
111(4)
Converting Character Codes to a String-The fromCharCode() Method
115(1)
Removing Leading and Trailing Whitespace-The trim() Method
115(1)
Array Objects
116(10)
Finding Out How Many Elements Are in an Array-The length Property
116(1)
Adding Elements-The push() Method
117(1)
Joining Arrays-The concat() Method
117(1)
Copying Part of an Array-The slice() Method
118(1)
Converting an Array into a Single String-The join() Method
119(1)
Putting Your Array in Order-The sort() Method
119(2)
Putting Your Array into Reverse Order-The reverse() Method
121(1)
Finding Array Elements-The index0i() and lastIndex0f() Methods
122(1)
Iterating through an Array without Loops
123(3)
The Math Object
126(8)
The abs() Method
127(1)
Finding the Largest and Smallest Numbers-The min() and max() Methods
127(1)
Rounding Numbers
127(4)
The random() Method
131(1)
The pow() Method
132(2)
Number Objects
134(1)
The toFixed() Method
134(1)
Date Objects
135(13)
Creating a Date Object
135(1)
Getting Date Values
136(3)
Setting Date Values
139(1)
Calculations and Dates
140(1)
Getting Time Values
140(3)
Setting Time Values
143(1)
Creating Your Own Custom Objects
144(4)
Creating New Types of Objects (Reference Types)
148(3)
Defining a Reference Type
149(1)
Creating and Using Reference Type Instances
150(1)
Summary
151(2)
Chapter 6 String Manipulation 153(40)
Additional String Methods
154(4)
The split() Method
154(2)
The replace() Method
156(1)
The search() Method
157(1)
The match() Method
157(1)
Regular Expressions
158(17)
Simple Regular Expressions
159(3)
Regular Expressions: Special Characters
162(8)
Text, Numbers, and Punctuation
162(3)
Repetition Characters
165(1)
Position Characters
166(4)
Covering All Eventualities
170(1)
Grouping Regular Expressions
171(2)
Reusing Groups of Characters
173(2)
The String Object
175(8)
The split() Method
175(2)
The replace() Method
177(2)
The search() Method
179(1)
The match() Method
180(3)
Using the RegExp Object's Constructor
183(8)
Telephone Number Validation
185(2)
Validating a Postal Code
187(2)
Validating an E-mail Address
189(5)
Validating a Domain Name
189(1)
Validating a Person's Address
190(1)
Validating the Complete Address
190(1)
Summary
191(2)
Chapter 7 Date, Time, And Timers 193(12)
World Time
194(6)
Setting and Getting a Date Object's UTC Date and Time
197(3)
Timers in a Web Page
200(3)
One-Shot Timer
200(2)
Setting a Timer that Fires at Regular Intervals
202(1)
Summary
203(2)
Chapter 8 Programming The Browser 205(24)
Introduction to the Browser's Objects
206(12)
The window Object
207(1)
The history Object
208(1)
The location Object
209(1)
The navigator Object
210(3)
The geolocation Object
210(3)
The screen Object
213(1)
The document Object
213(1)
Using the document Object
214(2)
The images Collection
216(2)
The links Collection
218(1)
Determining the User's Browser
218(7)
Feature Detection
218(3)
Browser Sniffing
221(4)
Summary
225(4)
Chapter 9 DOM Scripting 229(42)
The Web Standards
231(3)
HTML
232(1)
ECMAScript
233(1)
The Document Object Model
234(25)
The DOM Standard
234(2)
Level 0
234(1)
Level 1
234(1)
Level 2
235(1)
Level 3
235(1)
Level 4
235(1)
Browser Compliance with the Standards
235(1)
Differences between the DOM and the BOM
236(1)
Representing the HTML Document as a Tree Structure
236(2)
What Is a Tree Structure?
236(1)
An Example HTML Page
237(1)
The Core DOM Objects
238(2)
Base DOM Objects
238(1)
High-Level DOM Objects
239(1)
DOM Objects and Their Properties and Methods
240(19)
The Document Object and its Methods
240(6)
The Element Object
246(4)
The Node Object
250(9)
Manipulating the DOM
259(9)
Accessing Elements
259(1)
Changing Appearances
259(4)
Using the style Property
259(3)
Changing the class Attribute
262(1)
Positioning and Moving Content
263(1)
Example: Animated Advertisement
264(9)
Are We There Yet?
264(1)
Performing the Animation
265(3)
Summary
268(3)
Chapter 10 Events 271(64)
Types of Events
272(1)
Connecting Code to Events
273(10)
Handling Events via HTML Attributes
273(7)
Handling Events via Object Properties
280(3)
The Standard Event Model
283(15)
Connecting Code to Events-The Standard Way
283(6)
Using Event Data
289(9)
Event Handling in Old Versions of Internet Explorer
298(9)
Accessing the event Object
298(2)
Using Event Data
300(7)
Writing Cross-Browser Code
307(10)
Native Drag and Drop
317(16)
Making Content Draggable
318(1)
Creating a Drop Target
319(6)
Transferring Data
325(8)
Summary
333(2)
Chapter 11 HTML Forms: Interacting With The User 335(56)
HTML Forms
336(2)
Traditional Form Object Properties and Methods
338(37)
HTML Elements in Forms
339(1)
Common Properties and Methods
340(1)
The name Property
340(1)
The value Property
340(1)
The form Property
340(1)
The type Property
340(1)
The focus() and blur() Methods
340(1)
Button Elements
341(4)
Text Elements
345(6)
The Text Box
345(5)
Problems with Firefox and the blur Event
350(1)
The Password Text Box
351(1)
The Hidden Text Box
351(1)
The textarea Element
351(4)
Check Boxes and Radio Buttons
355(9)
Selection Boxes
364(11)
Adding and Removing Options
365(4)
Adding New Options with Standard Methods
369(1)
Select Element Events
370(5)
HTML5 Form Object Properties and Methods
375(11)
New Input Types
376(4)
New Elements
380(13)
The <output/> Element
380(2)
The <meter/> and <progress/> Elements
382(4)
Summary
386(5)
Chapter 12 JSON 391(12)
XML
392(1)
JSON
393(7)
Simple Values
394(1)
Objects
394(1)
Arrays
395(1)
Serializing Into JSON
396(1)
Parsing JSON
396(4)
Summary
400(3)
Chapter 13 Data Storage 403(32)
Baking Your First Cookie
404(12)
A Fresh-Baked Cookie
404(9)
Viewing Cookies in Internet Explorer
404(5)
Viewing Cookies in Firefox
409(2)
Viewing Cookies in Chrome
411(2)
The Cookie String
413(11)
name and value
413(1)
expires
413(1)
path
414(1)
domain
415(1)
secure
416(1)
Creating a Cookie
416(3)
Getting a Cookie's Value
419(5)
Cookie Limitations
424(1)
A User May Disable Cookies
424(1)
Number and Information Limitation
425(1)
Cookie Security and IE
425(1)
Web Storage
426(6)
Setting Data
427(1)
Getting Data
428(1)
Removing Data
428(1)
Storing Data as Strings
428(3)
Viewing Web Storage Content
431(1)
Summary
432(3)
Chapter 14 AJAX 435(28)
What Is Ajax?
436(2)
What Can It Do?
436(1)
Google Maps
436(1)
Google Suggest
436(1)
Browser Support
436(2)
Using the XMLHttpRequest Object
438(3)
Creating an XMLHttpRequest Object
438(1)
Using the XMLHttpRequest Object
438(2)
Asynchronous Requests
440(1)
Creating a Simple Ajax Module
441(3)
Planning the HttpRequest Module
441(1)
The HttpRequest Constructor
442(1)
Creating the send() Method
443(1)
The Full Code
443(1)
Validating Form Fields with Ajax
444(9)
Requesting Information
445(1)
The Received Data
445(1)
Before You Begin
446(7)
A Web Server
446(1)
PHP
447(6)
Things to Watch Out For
453(9)
Security Issues
454(1)
The Same-Origin Policy
454(1)
CORS
454(1)
Usability Concerns
455(12)
The Browser's Back Button
455(1)
Creating a Back/Forward-Capable Form with an IFrame
455(1)
The Server Response
456(4)
Dealing with Delays
460(1)
Degrade Gracefully When Ajax Fails
461(1)
Summary
462(1)
Chapter 15 HTML5 Media 463(20)
A Primer
464(3)
Scripting Media
467(14)
Methods
468(3)
Properties
471(6)
Events
477(4)
Summary
481(2)
Chapter 16 jQuery 483(22)
Getting jQuery
484(1)
jQuery's API
485(19)
Selecting Elements
485(2)
Changing Style
487(3)
Adding and Removing CSS Classes
488(1)
Toggling Classes
489(1)
Checking if a Class Exists
490(1)
Creating, Appending, and Removing Elements
490(2)
Creating Elements
491(1)
Appending Elements
491(1)
Removing Elements
492(1)
Handling Events
492(2)
The jQuery Event Object
493(1)
Rewriting the Tab Strip with jQuery
494(3)
Using jQuery for Ajax
497(9)
Understanding the jQuery Function
497(1)
Automatically Parsing JSON Data
498(1)
The jqXHR Object
498(6)
Summary
504(1)
Chapter 17 Other Javascript Libraries 505(44)
Digging into Modernizr
506(9)
Getting Modernizr
507(1)
Modernizr's API
508(1)
Custom Tests
509(1)
Loading Resources
510(5)
Diving into Prototype
515(16)
Getting Prototype
515(1)
Testing Your Prototype Installation
516(1)
Retrieving Elements
517(2)
Selecting Elements with CSS Selectors
518(1)
Performing an Operation on Elements Selected with $$()
519(1)
Manipulating Style
519(1)
Creating, Inserting, and Removing Elements
520(1)
Creating an Element
520(1)
Adding Content
520(1)
Removing an Element
521(1)
Using Events
521(1)
Rewriting the Tab Strip with Prototype
522(3)
Using Ajax Support
525(6)
Delving into MooTools
531(15)
Getting MooTools
531(1)
Testing Your MooTools Installation
531(2)
Finding Elements
533(1)
Selecting Elements with CSS Selectors
533(1)
Performing Operations on Elements
533(1)
Changing Style
534(1)
Creating, Inserting, and Removing Elements
535(1)
Using Events
536(1)
Rewriting the Tab Strip with MooTools
537(3)
Ajax Support in MooTools
540(6)
Summary
546(3)
Chapter 18 Common Mistakes, Debugging, And Error Handling 549(38)
D'oh! I Can't Believe I Just Did That: Some Common Mistakes
550(5)
Undefined Variables
550(1)
Case Sensitivity
551(1)
Incorrect Number of Closing Braces
552(1)
Incorrect Number of Closing Parentheses
553(1)
Using Equals (=) Rather than Equality (==)
553(1)
Using a Method as a Property and Vice Versa
554(1)
Missing Plus Signs during Concatenation
554(1)
Error Handling
555(8)
Preventing Errors
555(1)
The try...catch Statements
556(7)
Throwing Errors
557(5)
Nested try...catch Statements
562(1)
finally Clauses
562(1)
Debugging
563(20)
Debugging in Chrome (and Opera)
564(10)
Setting Breakpoints
566(1)
Scope Variables and Watches
566(1)
Stepping through Code
567(4)
The Console
571(2)
Call Stack Window
573(1)
Debugging in Internet Explorer
574(4)
Setting Breakpoints
576(1)
Adding Watches
576(1)
Stepping through Code
576(1)
The Console
577(1)
Debugging in Firefox with Firebug
578(2)
Setting Breakpoints
578(1)
Watches
579(1)
Stepping through Code
580(1)
The Console
580(1)
Debugging in Safari
580(3)
Setting Breakpoints
583(1)
Adding Watches
583(1)
Stepping through Code
583(1)
The Console
583(1)
Summary
583(4)
Appendix A: Answers To Exercises 587(66)
Appendix B: Javascript Core Reference 653(30)
Appendix C: W3C Dom Reference 683(32)
Appendix D: Latin-1 Character Set 715(8)
Index 723
About the authors

Jeremy McPeak is a professional programmer and analyst who works extensively with JavaScript and C#. He coauthored both of the previous editions of Beginning JavaScript, and authored the well-reviewed JavaScript 24-Hour Trainer. He contributes to the online, web-centric learning site Tuts+ Code, covering topics such as JavaScript, C#, and the .NET Framework.

Paul Wilton owns his own company, providing online booking systems to vacation property owners, which is largely developed using JavaScript.