JavaScript for Programmers

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

PRACTICAL, EXAMPLE-RICH COVERAGE OF:
  • XHTML®
  • CSS®
  • JavaScript™: Control Statements,
  • Functions, Arrays, Objects
  • JSON (JavaScript Object Notation)
  • XHTML DOM®: Objects and Collections
  • JavaScript Event-Driven Programming
  • XML® and RSS
  • XML DOM
  • Rich Internet Applications
  • Asynchronous JavaScript and XML (Ajax)
  • XMLHttpRequest
  • Dojo Toolkit
  • Consuming Web Services
  • And more…

 VISIT WWW.DEITEL.COM

  • Download code examples
  • Check out the growing list of programming, Web 2.0 and software-related Resource Centers
  • To receive updates for this book, subscribe to the free Deitel® Buzz Online e-mail newsletter at    www.deitel.com/newsletter/subscribe.html
  • Read archived issues of the Deitel® Buzz Online
  • Contact [email protected] for information on corporate training courses delivered on-site worldwide

 

The practicing programmer’s Deitel® guide to XHTML®, CSS®, JavaScript, XML® and Ajax RIA development.

 

This book applies the Deitel signature live-code approach to teaching the client side of Rich Internet Applications (RIA) development. The book presents concepts in the context of 100+ fully tested programs (6,000+ lines of code), complete with syntax shading, detailed descriptions and sample outputs. The book features over 150 tips that will help you build robust client-side web applications.

 

Start with an introduction to Extensible HyperText Markup Language (XHTML®) and Cascading Style Sheets (CSS®), then rapidly move on to the details of JavaScript™ programming. Finish with more advanced client-side development technologies including XHTML’s Document Object Model (DOM®), Extensible Markup Language (XML®), XML’s DOM, JavaScript Object Notation (JSON) and Asynchronous JavaScript and XML (Ajax). When you’re finished, you’ll have everything you need to build the client side of Web 2.0 Rich Internet Applications (RIAs). The book culminates with several substantial Ajax-enabled RIAs, including a book cover viewer (JavaScript/DOM), an address book (Ajax/consuming web services) and a calendar application (Ajax/Dojo/consuming web services).

 

TheDeitel® Developer Seriesis designed for professional programmers. The series presents focused treatments of emerging technologies, including .NET, Java™, web services, Internet and web development and more.          

 

Pre-Publication Reviewer Testimonials

 

“One of the best introductions to JavaScript.”—Raymond Wisman, Indiana University Southeast

 

“Cements the browser as a first-class development platform.”—Johnvey Hwang, Splunk, Inc.

 

“Excellent for learning to develop standards-compliant web applications.”—Paul Vencill, MITRE, Inc.

 

“The CSS chapter is compact, concise and full of useful info!”—Billy B. L. Lim, Illinois State University

 

“A good introduction to the DOM; doesn’t trip over cross-browser incompatibilities.”—Eric Lawrence, Microsoft

 

“Exceptionally clear Ajax tutorial; best I’ve reviewed! Great solutions for the very cool type-ahead and edit-in-place Ajax features. ‘Libraries to Help Eliminate Cross-Browser Compatibility Issues’ is fantastic. This book and your websites will be often-visited resources (if not best practices in themselves).”—John Peterson, Insync and V.I.O. Inc.

 

“I wish I’d had this when I was learning to program.”—Joe Kromer, New Perspective

 

Author(s): Paul J. Deitel, Harvey M. Deitel
Edition: 1
Publisher: Prentice Hall
Year: 2009

Language: English
Pages: 436
Tags: Библиотека;Компьютерная литература;HTML / CSS / JavaScript;

Contents......Page 10
Preface......Page 16
Before You Begin......Page 24
1 Introduction......Page 26
1.1 Introduction......Page 27
1.2 History of the Internet and World Wide Web......Page 28
1.4 Web 2.0......Page 30
1.5 Key Software Trend: Object Technology......Page 32
1.6 JavaScript: Object-Based Scripting for the Web......Page 33
1.8 Web Resources......Page 34
2 Introduction to XHTML......Page 35
2.1 Introduction......Page 36
2.3 First XHTML Example......Page 37
2.5 Headings......Page 40
2.6 Linking......Page 41
2.7 Images......Page 44
2.8 Special Characters and Horizontal Rules......Page 47
2.9 Lists......Page 49
2.10 Tables......Page 52
2.11 Forms......Page 56
2.12 Internal Linking......Page 63
2.13 meta Elements......Page 65
2.14 Web Resources......Page 67
3 Cascading Style Sheets™ (CSS)......Page 68
3.1 Introduction......Page 69
3.2 Inline Styles......Page 70
3.3 Embedded Style Sheets......Page 71
3.4 Conflicting Styles......Page 74
3.5 Linking External Style Sheets......Page 77
3.6 Positioning Elements......Page 79
3.7 Backgrounds......Page 83
3.8 Element Dimensions......Page 84
3.9 Box Model and Text Flow......Page 86
3.10 Media Types......Page 90
3.11 Building a CSS Drop-Down Menu......Page 92
3.12 User Style Sheets......Page 94
3.14 Web Resources......Page 98
4 JavaScript: Introduction to Scripting......Page 99
4.1 Introduction......Page 100
4.2 Simple Program: Displaying a Line of Text in a Web Page......Page 101
4.3 Modifying Our First Program......Page 104
4.4.1 Dynamic Welcome Page......Page 109
4.4.2 Adding Integers......Page 113
4.6 Arithmetic......Page 115
4.7 Decision Making: Equality and Relational Operators......Page 116
4.8 Web Resources......Page 120
5 JavaScript: Control Statements I......Page 121
5.2 Control Statements......Page 122
5.3 if Selection Statement......Page 123
5.4 if…else Selection Statement......Page 124
5.5 while Repetition Statement......Page 128
5.6 Counter-Controlled Repetition......Page 129
5.7 Formulating Algorithms: Sentinel-Controlled Repetition......Page 131
5.8 Formulating Algorithms: Nested Control Statements......Page 134
5.9 Assignment Operators......Page 137
5.10 Increment and Decrement Operators......Page 138
5.11 Web Resources......Page 141
6 JavaScript: Control Statements II......Page 142
6.2 Essentials of Counter-Controlled Repetition......Page 143
6.3 for Repetition Statement......Page 145
6.4 Examples Using the for Statement......Page 149
6.5 switch Multiple-Selection Statement......Page 153
6.6 do…while Repetition Statement......Page 158
6.7 break and continue Statements......Page 160
6.8 Labeled break and continue Statements......Page 163
6.9 Logical Operators......Page 165
7 JavaScript: Functions......Page 170
7.2 Functions......Page 171
7.4 Function Definitions......Page 172
7.5 Random Number Generation......Page 177
7.6 Example: Game of Chance......Page 182
7.7 Another Example: Random Image Generator......Page 188
7.8 Scope Rules......Page 190
7.9 JavaScript Global Functions......Page 192
7.10 Recursion......Page 193
7.11 Recursion vs. Iteration......Page 197
8 JavaScript: Arrays......Page 198
8.2 Arrays......Page 199
8.3 Declaring and Allocating Arrays......Page 200
8.4 Examples Using Arrays......Page 201
8.5 Random Image Generator Using Arrays......Page 208
8.6 References and Reference Parameters......Page 209
8.7 Passing Arrays to Functions......Page 210
8.8 Sorting Arrays......Page 213
8.9 Multidimensional Arrays......Page 215
8.10 Building an Online Quiz......Page 219
9 JavaScript: Objects......Page 222
9.2 Introduction to Object Technology......Page 223
9.3 Math Object......Page 226
9.4.1 Fundamentals of Characters and Strings......Page 227
9.4.2 Methods of the String Object......Page 228
9.4.3 Character-Processing Methods......Page 230
9.4.4 Searching Methods......Page 231
9.4.5 Splitting Strings and Obtaining Substrings......Page 234
9.4.6 XHTML Markup Methods......Page 235
9.5 Date Object......Page 238
9.6 Boolean and Number Objects......Page 243
9.7 document Object......Page 244
9.8 window Object......Page 245
9.9 Using Cookies......Page 250
9.10 Multipage HTML and JavaScript Application......Page 254
9.11 Using JSON to Represent Objects......Page 262
10 Document Object Model (DOM): Objects and Collections......Page 263
10.2 Modeling a Document: DOM Nodes and Trees......Page 264
10.3 Traversing and Modifying a DOM Tree......Page 267
10.4 DOM Collections......Page 278
10.5 Dynamic Styles......Page 280
10.6 Summary of the DOM Objects and Collections......Page 286
11 JavaScript: Events......Page 288
11.2 Registering Event Handlers......Page 289
11.3 Event onload......Page 292
11.4 Event onmousemove, the event Object and this......Page 293
11.5 Rollovers with onmouseover and onmouseout......Page 298
11.6 Form Processing with onfocus and onblur......Page 302
11.7 Form Processing with onsubmit and onreset......Page 305
11.8 Event Bubbling......Page 307
11.9 More Events......Page 309
11.10 Web Resources......Page 310
12 XML and RSS......Page 311
12.2 XML Basics......Page 312
12.3 Structuring Data......Page 315
12.4 XML Namespaces......Page 322
12.5 Document Type Definitions (DTDs)......Page 325
12.6 W3C XML Schema Documents......Page 329
12.7 XML Vocabularies......Page 335
12.7.1 MathML™......Page 336
12.8 Extensible Stylesheet Language and XSL Transformations......Page 339
12.9 Document Object Model (DOM)......Page 349
12.10 RSS......Page 367
12.11 Web Resources......Page 374
13 Ajax-Enabled Rich Internet Applications......Page 375
13.1 Introduction......Page 376
13.2 Traditional Web Applications vs. Ajax Applications......Page 377
13.3 Rich Internet Applications (RIAs) with Ajax......Page 378
13.4 History of Ajax......Page 380
13.5 “Raw” Ajax Example Using the XMLHttpRequest Object......Page 381
13.6 Using XML and the DOM......Page 386
13.7 Creating a Full-Scale Ajax-Enabled Application......Page 391
13.8 Dojo Toolkit......Page 404
13.9 Web Resources......Page 413
A: XHTML Special Characters......Page 414
B: XHTML Colors......Page 415
C.1 Operator Precedence Chart......Page 418
A......Page 420
C......Page 421
D......Page 422
E......Page 423
H......Page 425
L......Page 426
N......Page 427
P......Page 428
R......Page 429
S......Page 430
U......Page 431
X......Page 432
Z......Page 433