Product Cover Image

AJAX, Rich Internet Applications, and Web Development for Programmers, Safari

By Paul J. Deitel, Harvey M. Deitel

Published by Prentice Hall

Published Date: Feb 6, 2008

More Product Info

Description

The practicing programmer's DEITEL® guide to AJAX, Rich Internet Applications, and web-application development

This book applies the Deitel signature live-code approach to teaching Web 2.0 application development. The book presents concepts in the context of more than 180 fully tested programs (18,000+ lines of code), complete with syntax shading, detailed descriptions, and sample outputs. It features hundreds of tips that will help you build robust applications.

Start with a concise introduction to XHTML, CSS, and JavaScript before rapidly moving on to more advanced client-side development with DOM, XML, AJAX, JSON, and other RIA technologies. Then proceed to server-side development with web servers, databases, PHP, Ruby on Rails, ASP.NET, JavaServer Faces, and web services. When you're finished, you'll have everything you need to build Web 2.0 applications.

The DEITEL Developer Series is designed for practicing programmers. The series presents focused treatments of emerging technologies, including .NET, JavaTM, web services, Internet and web development, and more.

Practical, example-rich coverage of:

  • Web 2.0
  • XHTML, CSS, JavaScript
  • DOM, XML, RSS
  • AJAX-Enabled Rich Internet Applications
  • JSON, Dojo, Script.aculo.us
  • Adobe® Flash CS3 and Flex
  • Web Servers (IIS and Apache)
  • Database (SQL, MySQL, ADO.NET and Java DB)
  • PHP, Ruby on Rails
  • ASP.NET, ASP.NET AJAX
  • JavaServer Faces (JSF)
  • SOAP-Based Web Services in Java
  • REST-Based Web Services in ASP.NET
  • Mashups
  • And more...

Visit www.deitel.com to:

  • Download code examples
  • Check out the growing list of programming, Web 2.0, and software-related Resource Centers
  • To receive updates on 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 deitel@deitel.com for information on corporate training courses delivered on-site worldwide

Pre-Publication Reviewer Testimonials

"This book is easily the most comprehensive resource of its kind I've seen yet."
--Jesse James Garrett, Adaptive Path

"A one-stop shop for learning the essentials of web programming."
--Anand Narayanaswamy, ASPAlliance.com

"Excellent for learning to develop standards-compliant web applications...takes you from the browser to the server and the database, covering web development across many programming languages."
--Paul Vencill, MITRE, Inc.

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

"Congratulations on this excellent work. The [Dive Into Web 2.0] chapter is simply astonishing! It's one of the better--if not the best--references on Web 2.0."
--José Antonio González Seco, Parlamento de Andalucia

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

"One of the best introductions to JavaScript."
--Raymond Wisman, Indiana University Southeast

"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 web sites will be often-visited resources (if not best practices in themselves)."
--John Peterson, Insync and V.I.O. Inc.

"Great chapter [on building Flash games]."
--Jennifer Powers, University of Albany

"A solid introduction to Adobe Flex with some very cool applications."
--Matt Chotin, Adobe

"A solid introduction to the capabilities and flexibilities of PHP. Inspired me to tighten up my own code! Easy to follow JSF development with database, Virtual Forms, and Google Maps."
--John Peterson, Insync and V.I.O. Inc.

"Excellent coverage of developing ASP.NET applications, with plenty of sample code."
--Peter Bromberg, VOIP, Inc.

"The web services chapter concludes a comprehensive education on Web 2.0. The examples go a long way to support the Web 2.0 mission of this book."
--George Semeczko, Independent Consultant

Table of Contents

Preface xix
Before You Begin xxxi

Part 1: Introduction 1

Chapter 1: Dive Into® Web 2.0 2

1.1     Introduction 3
1.2     What Is Web 2.0? 4
1.3     Search 7
1.4     Content Networks 12
1.5     User-Generated Content 13
1.6     Blogging 16
1.7     Social Networking 19
1.8     Social Media 23
1.9     Tagging 26
1.10   Social Bookmarking 28
1.11   Software Development 29
1.12   Rich Internet Applications (RIAs) 32
1.13   Web Services, Mashups, Widgets and Gadgets 34
1.14   Location-Based Services 37
1.15   XML, RSS, Atom, JSON and VoIP 38
1.16   Web 2.0 Monetization Models 39
1.17   Web 2.0 Business Models 41
1.18   Future of the Web 44
1.19   Where to Go for More Web 2.0 Information 48
1.20   Web 2.0 Bibliography 49
1.21   Web 2.0 Glossary 56

Part 2: The Ajax Client 66

Chapter 2: Introduction to XHTML 67

2.1     Introduction 68
2.2     Editing XHTML 69
2.3     First XHTML Example 69
2.4     W3C XHTML Validation Service 72
2.5     Headings 72
2.6     Linking 73
2.7     Images 76
2.8     Special Characters and Horizontal Rules 79
2.9     Lists 81
2.10   Tables 84
2.11   Forms 88
2.12   Internal Linking 95
2.13   meta Elements 98
2.14   Web Resources 99

Chapter 3: Cascading Style Sheets (CSS) 100

3.1     Introduction 101
3.2     Inline Styles 102
3.3     Embedded Style Sheets 103
3.4     Conflicting Styles 106
3.5     Linking External Style Sheets 109
3.6     Positioning Elements 111
3.7     Backgrounds 115
3.8     Element Dimensions 116
3.9     Box Model and Text Flow 118
3.10   Media Types 122
3.11   Building a CSS Drop-Down Menu 124
3.12   User Style Sheets 126
3.13   CSS 3 130
3.14   Web Resources 130

Chapter 4: JavaScript: Introduction to Scripting 131

4.1     Introduction 132
4.2     Simple Program: Displaying a Line of Text in a Web Page 133
4.3     Modifying Our First Program 136
4.4     Obtaining User Input with prompt Dialogs 141
4.5     Data Types in JavaScript 147
4.6     Arithmetic 147
4.7     Decision Making: Equality and Relational Operators 148
4.8     Web Resources 152

Chapter 5: JavaScript: Control Statements I 153

5.1     Introduction 154
5.2     Control Statements 154
5.3     if Selection Statement 155
5.4     if...else Selection Statement 156
5.5     while Repetition Statement 160
5.6     Counter-Controlled Repetition 161
5.7     Formulating Algorithms: Sentinel-Controlled Repetition 163
5.8     Formulating Algorithms: Nested Control Statements 166
5.9     Assignment Operators 169
5.10   Increment and Decrement Operators 170
5.11   Web Resources 173

Chapter 6: JavaScript: Control Statements II 174

6.1     Introduction 175
6.2     Essentials of Counter-Controlled Repetition 175
6.3     for Repetition Statement 177
6.4     Examples Using the for Statement 181
6.5     switch Multiple-Selection Statement 185
6.6     do...while Repetition Statement 190
6.7     break and continue Statements 192
6.8     Labeled break and continue Statements 195
6.9     Logical Operators 197
6.10   Web Resources 202

Chapter 7: JavaScript: Functions 203

7.1     Introduction 204
7.2     Program Modules in JavaScript 204
7.3     Programmer-Defined Functions 205
7.4     Function Definitions 205
7.5     Random Number Generation 210
7.6     Example: Game of Chance 215
7.7     Another Example: Random Image Generator 222
7.8     Scope Rules 223
7.9     JavaScript Global Functions 226
7.10   Recursion 227
7.11   Recursion vs. Iteration 230
7.12   Web Resources 231

Chapter 8: JavaScript: Arrays 232

8.1     Introduction 233
8.2     Arrays 233
8.3     Declaring and Allocating Arrays 234
8.4     Examples Using Arrays 235
8.5     Random Image Generator Using Arrays 242
8.6     References and Reference Parameters 243
8.7     Passing Arrays to Functions 244
8.8     Sorting Arrays 247
8.9     Multidimensional Arrays 249
8.10   Building an Online Quiz 253
8.11   Web Resources 255

Chapter 9: JavaScript: Objects 256

9.1     Introduction 257
9.2     Introduction to Object Technology 257
9.3     Math Object 260
9.4     String Object 261
9.5     Date Object 272
9.6     Boolean and Number Objects 277
9.7     document Object 278
9.8     window Object 279
9.9     Using Cookies 284
9.10   Multipage HTML and JavaScript Application 288
9.11   Using JSON to Represent Objects 296
9.12   Web Resources 297

Chapter 10: Document Object Model (DOM): Objects and Collections 298

10.1     Introduction 299
10.2     Modeling a Document: DOM Nodes and Trees 299
10.3     Traversing and Modifying a DOM Tree 302
10.4     DOM Collections 313
10.5     Dynamic Styles 315
10.6     Summary of the DOM Objects and Collections 321
10.7     Web Resources 322

Chapter 11: JavaScript: Events 323

11.1     Introduction 324
11.2     Registering Event Handlers 324
11.3     Event onload 327
11.4     Event onmousemove, the event Object and this 328
11.5     Rollovers with onmouseover and onmouseout 333
11.6     Form Processing with onfocus and onblur 338
11.7     Form Processing with onsubmit and onreset 341
11.8     Event Bubbling 343
11.9     More Events 345
11.10   Web Resources 346

Chapter 12: XML and RSS 347

12.1     Introduction 348
12.2     XML Basics 348
12.3     Structuring Data 351
12.4     XML Namespaces 358
12.5     Document Type Definitions (DTDs) 361
12.6     W3C XML Schema Documents 365
12.7     XML Vocabularies 372
12.8     Extensible Stylesheet Language and XSL Transformations 376
12.9     Document Object Model (DOM) 385
12.10   RSS 402
12.11   Web Resources 410

Chapter 13: Ajax-Enabled Rich Internet Applications 411

13.1     Introduction 412
13.2     Traditional Web Applications vs. Ajax Applications 413
13.3     Rich Internet Applications (RIAs) with Ajax 415
13.4     History of Ajax 417
13.5     "Raw" Ajax Example Using the XMLHttpRequest Object 417
13.6     Using XML and the DOM 423
13.7     Creating a Full-Scale Ajax-Enabled Application 427
13.8     Dojo Toolkit 440
13.9     Web Resources 449

Part 3: Rich Internet Application Client Technologies 451

Chapter 14: Adobe® Flash® CS3 452

14.1     Introduction 453
14.2     Flash Movie Development 454
14.3     Learning Flash with Hands-On Examples 456
14.4     Publishing Your Flash Movie 472
14.5     Creating Special Effects with Flash 473
14.6     Creating a Website Splash Screen 485
14.7     ActionScript 491
14.8     Web Resources 491

Chapter 15: Adobe® Flash® CS3: Building an Interactive Game 492

15.1     Introduction 493
15.2     Object-Oriented Programming 495
15.3     Objects in Flash 495
15.4     Cannon Game: Preliminary Instructions and Notes 497
15.5     Adding a Start Button 498
15.6     Creating Moving Objects 498
15.7     Adding the Rotating Cannon 503
15.8     Adding the Cannonball 505
15.9     Adding Sound and Text Objects to the Movie 508
15.10   Adding the Time Counter 509
15.11   Detecting a Miss 511
15.12   Adding Collision Detection 512
15.13   Finishing the Game 515
15.14   ActionScript 3.0 Elements Introduced in This Chapter 516

Chapter 16: Adobe® Flex 2 and Rich Internet Applications 517

16.1     Introduction 518
16.2     Flex Platform Overview 519
16.3     Creating a Simple User Interface 520
16.4     Accessing XML Data from Your Application 531
16.5     Interacting with Server-Side Applications 545
16.6     Customizing Your User Interface 554
16.7     Creating Charts and Graphs 558
16.8     Connection Independent RIAs on the Desktop: Adobe Integrated Runtime (AIR) 566
16.9     Flex 3 Beta 567
16.10   Web Resources 567

Part 3: Rich Internet Application Server Technologies 568

Chapter 17: Web Servers (IIS and Apache) 569

17.1     Introduction 570
17.2     HTTP Transactions 570
17.3     Multitier Application Architecture 574
17.4     Client-Side Scripting versus Server-Side Scripting 575
17.5     Accessing Web Servers 576
17.6     Microsoft Internet Information Services (IIS) 576
17.7     Apache HTTP Server 581
17.8     Requesting Documents 583
17.9     Web Resources 584

Chapter 18: Database: SQL, MySQL, ADO.NET 2.0 and Java DB 585

18.1     Introduction 586
18.2     Relational Databases 587
18.3     Relational Database Overview: A books Database 588
18.4     SQL 591
18.5     MySQL 600
18.6     Instructions for Installing MySQL 600
18.7     Instructions for Setting Up a MySQL User Account 601
18.8     Creating a Database in MySQL 602
18.9     ADO.NET Object Model 602
18.10   Java DB/Apache Derby 604
18.11   Web Resources 604

Chapter 19: PHP 606

19.1     Introduction 607
19.2     PHP Basics 608
19.3     String Processing and Regular Expressions 618
19.4     Form Processing and Business Logic 623
19.5     Connecting to a Database 630
19.6     Using Cookies 634
19.7     Dynamic Content 640
19.8     Operator Precedence Chart 649
19.9     Web Resources 651

Chapter 20: Ruby on Rails 652

20.1     Introduction 653
20.2     Ruby 653
20.3     Rails Framework 660
20.4     ActionController and ActionView 662
20.5     A Database-Driven Web Application 665
20.6     Case Study: Message Forum 670
20.7     Script.aculo.us 691
20.8     Web Resources 699

Chapter 21: ASP.NET 2.0 and ASP.NET Ajax 700

21.1     Introduction 701
21.2     Creating and Running a Simple Web Form Example 702
21.3     Web Controls 716
21.4     Session Tracking 737
21.5     Case Study: Connecting to a Database in ASP.NET 753
21.6     Case Study: Secure Books Database Application 765
21.7     ASP.NET Ajax 793
21.8     Web Resources 797

Chapter 22: JavaServer FacesWeb Applications 798

22.1     Introduction 799
22.2     Java Web Technologies 800
22.3     Creating and Running a Simple Application in Netbeans 803
22.4     JSF Components 820
22.5     Session Tracking 833
22.6     Web Resources 856

Chapter 23: Ajax-Enabled JavaServer Faces Web Applications 858

23.1     Introduction 859
23.2     Accessing Databases in Web Applications 860
23.3     Ajax-Enabled JSF Components 872
23.4     AutoComplete Text Field and Virtual Forms 873
23.5     Google Maps Map Viewer Component 881
23.6     Web Resources 890

Chapter 24: Web Services 891

24.1     Introduction 892
24.2     Java Web Services Basics 894
24.3     Creating, Publishing, Testing and Describing a Web Service 894
24.4     Consuming a Web Service 905
24.5     SOAP 914
24.6     Session Tracking in Web Services 915
24.7     Consuming a Database-Driven Web Service from a Web Application 931
24.8     Passing an Object of a User-Defined Type to a Web Service 939
24.9     REST-Based Web Services in ASP.NET 949
24.10   Web Resources 960

Index 962

Purchase Info

ISBN-10: 0-13-714230-7

ISBN-13: 978-0-13-714230-9

Format: Safari PTG

This publication is not currently for sale.