AJAX, Rich Internet Applications, and Web Development for Programmers

Paperback (Print)
Buy Used
Buy Used from BN.com
$35.29
(Save 41%)
Item is in good condition but packaging may have signs of shelf wear/aging or torn packaging.
Condition: Used – Good details
Used and New from Other Sellers
Used and New from Other Sellers
from $15.00
Usually ships in 1-2 business days
(Save 74%)
Other sellers (Paperback)
  • All (11) from $15.00   
  • New (5) from $32.88   
  • Used (6) from $15.00   

Overview

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,

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,
  • 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

Read More Show Less

Product Details

  • ISBN-13: 9780131587380
  • Publisher: Prentice Hall
  • Publication date: 2/12/2008
  • Series: Deitel Developer Series
  • Pages: 991
  • Product dimensions: 6.94 (w) x 9.12 (h) x 1.84 (d)

Meet the Author

Paul J. Deitel and Dr. Harvey M. Deitel are the founders of Deitel & Associates, Inc., the internationally recognized programming languages content-creation, corporate-training and Internet business development organization. The Deitels have written many international best-selling programming languages textbooks that millions of people worldwide have used to master C, C++, Java, C#,®, Perl, Python, and Internet and web programming.

Read More Show Less

Read an Excerpt

...the challenges are for the designers of these applications: to forget what we think we know about the limitations of the Web, and begin to imagine a wider, richer range of possibilities. It's going to be fun.
—Jesse James Garrett, Adaptive Path
"Ajax: A New Approach to Web Applications"
(adaptivepath.com/ideas/essays/archives/000385.php)Introduction

Welcome to Internet and web programming andWeb 2.0! And welcome to a walkthrough of the Web 2.0 phenomenon from the technical, business and social perspectives. We've worked hard to create what we hope you'll find to be an informative, entertaining and challenging learning experience. At Deitel & Associates, we write programming language professional books and textbooks for Prentice Hall, deliver corporate training worldwide and developWeb 2.0 Internet businesses. This book reflects today's Web 2.0, Ajax-based, Rich Internet Application-development methodologies.

The technologies you'll learn here are appropriate for experienced professionals who build substantial information systems. You'll find "industrial-strength" code examples. We have attempted to write in a clear and straightforward manner using best practices. Perhaps most important, the book presents hundreds of working code examples and shows the outputs produced when these examples are rendered in browsers or run on computers. We present all concepts in the context of complete working programs.We call this the "live-code approach." All of the source code is available for download from

www.deitel.com/books/ajaxfp/

under the heading "Download Code Examples and Other Premium Content for Registered Users," once you've registeredand logged on to our site.

The early chapters present a carefully paced introduction to "client-side" web programming, using the popular JavaScript language and the closely related technologies of XHTML (Extensible HyperText Markup Language), CSS (Cascading Style Sheets) and the DOM (Document Object Model). The material in the JavaScript chapters presents a solid foundation for the deeper treatment of scripting in the Adobe Flash, Adobe Flex, PHP and Ruby on Rails chapters later in the book. Experienced programmers will read the early chapters quickly and find the treatment of scripting in the later chapters to be rigorous and challenging.

Today's users are accustomed to desktop applications with rich graphical user interfaces (GUIs), such as those used on Apple's Mac OS X systems, Microsoft Windows systems, various Linux systems and more. Users want applications that employ the multimedia capabilities of graphics, images, animation, audio and video. They want applications that can run on the Internet and the web and communicate with other applications.

Users want to apply database technologies for storing and manipulating their business and personal data. They want applications that are not limited to the desktop or even to some local computer network, but that can integrate Internet and web components, and remote databases. Programmers want to use all these capabilities in a truly portable manner so that applications will run without modification on a variety of platforms.

In this book, we present a number of powerful software technologies that will enable you to build these kinds of systems. Early in the book we focus on building the portions of web-based applications that reside on the client side (i.e., the portions of applications that typically run in web browsers such as Mozilla's Firefox or Microsoft's Internet Explorer), using technologies such as the XHTML, JavaScript, CSS, Flash, Flex and Extensible Markup Language (

If you have questions as you read this book, send an e-mail to deitel@deitel.com—we'll respond promptly. For updates on the book and the status of all supporting software, and for the latest news on Deitel publications and services, visit www.deitel.com. Sign up at www.deitel.com/newsletter/subscribe.html for the free Deitel® Buzz Online e-mail newsletter and check out www.deitel.com/ResourceCenters.html for our growing list of Internet and web programming, Internet business, Web 2.0 and related Resource Centers. Each week we announce our latest Resource Centers in the newsletter.Key Features

Here's some of the key features of Ajax, Rich Internet Applications and Web Development for Programmers:

  • Reflects today's Web 2.0, Ajax-based, Rich Internet Application-development methodologies.
  • Coverage of the two leading web browsers—Internet Explorer and Firefox. All client-side applications in the book run correctly on both browsers.
  • Focus on Web 2.0 technologies and concepts.
  • Chapter on Web 2.0 and Internet Business (reviewed by leaders in the Web 2.0 community).
  • Focus on building Rich Internet Applications with the interactivity of desktop applications.
  • Chapter on building Ajax-enabled web applications with "raw" Ajax and with the Dojo JavaScript libraries. Applications in this chapter demonstrate partial-page updates and type-ahead capabilities.
  • Chapter on Adobe Flex—a Rich Internet Application framework for creating scalable, cross-platform, multimedia-rich applications for delivery within the enterprise or across the Internet.
  • Chapter on rapid applications development of database-driven web applications with Ruby on Rails; also discusses developing Ajax applications with the Prototype and Script.aculo.us libraries.
  • Two chapters on Adobe Flash CS3, including building a computer game.
  • Significant treatment of client-side scripting with JavaScript.
  • Significant treatments of XHTML DOM manipulation and JavaScript events.
  • Significant treatment of
  • Chapter on building SOAP-based web services with Java and REST-based web services with ASP.NET (using Visual Basic).
  • Chapter on PHP 5.
  • Coverage of ASP.NET, featuring ASP.NET Ajax.
  • JavaServer Faces (JSF) coverage emphasizing building Ajax-enabled JSF applications.
  • Client-side case studies that enable you to interact with preimplemented serverside applications and web services that we host at test.deitel.com.
  • Case studies including Deitel Cover Viewer (JavaScript/DOM), Address Book
  • (Ajax), Cannon Game (Flash), Weather/Yahoo! Maps Mashup (Flex), Mailing List (PHP/MySQL), Message Forum and Flickr Photo Viewer (Ruby on Rails), Guest Book and Secure Books Database (ASP.NET), Address Book with Google Maps (JavaServer Faces) and Blackjack (JAX-WS web services).

All of this has been carefully reviewed by a team of 38 distinguished industry developers and academics.AJAX, Rich Internet Applications and Web Development for Programmers Architecture

This book focuses on Web 2.0 and Rich Internet Application (RIA) development. Our goal is to develop webtop applications that have the responsiveness, look and feel of traditional desktop applications. Deitel & Associates, Inc. has evolved into a development organization, while continuing its focus on programming languages textbook and professional book authoring, and corporate training. We're building the infrastructure for the Internet businesses we're designing and developing as part of our Web 2.0 Internet Business Initiative. This book includes discussions of many practical issues we've encountered in developing that infrastructure.

The book is divided into several parts. Chapter 1 introduces Web 2.0 from the technical, business and social perspectives, and provides a foundation for understanding Rich Internet Application development. If you are a serious web developer, you'll want to test your web applications across many browsers and platforms. The examples for the book execute correctly on both Microsoft's Internet Explorer 7 (IE7) and Mozilla's Firefox 2 (FF2) browsers. Most of the examples will also work in other browsers such as Opera and Safari, but may not work on earlier browsers. Microsoft Windows users should upgrade to IE7 and install Firefox; readers with other operating systems should install Firefox.

The second part of the book, Chapters 2–13, presents a detailed treatment of Ajax component technologies, including a comprehensive treatment of JavaScript that spans nine chapters and concludes with Chapter 13's treatment of Ajax development. Ajax is not a new technology—we've been writing about all but one of its component technologies since 1999, and many of the technologies existed before that. However, Ajax is one of the key technologies of Web 2.0 and RIAs. Chapters 2–13 cover "raw" Ajax programming, where you'll handle the details yourself—several later chapters in the book demonstrate technologies that encapsulate Ajax functionality to help you easily build Ajax-based applications that operate across a wide variety of browsers and browser versions without your having to be concerned with the low-level details.

The third part of the book, Chapters 13–24, focuses on both the client and server sides of the GUI and the graphical part of RIA development. Here we cover client-side technologies such as Adobe Flash and Adobe Flex that use, or can be combined with, Ajax or Ajax-like capabilities to develop RIAs. Each of these technologies also can consume web services. Next, we present the server side of web application development with discussions of web servers (IIS and Apache), databases, server-side scripting languages such as PHP and Ruby on Rails, and several server-side frameworks such as ASP.NET 2.0 and Java-Server Faces. We complete our server-side discussion with a chapter on building both SOAP-based and REST-based web services.

You may have noticed that Chapter 13, Ajax-Enabled Rich Internet Applications, overlaps the second and third parts of the book. Chapter 13 serves as a bridge from "raw" Ajax development to "encapsulated" Ajax development with the Dojo libraries.Teaching Approach

AJAX, Rich Internet Applications and Web Development for Programmers contains a rich collection of examples. The book concentrates on the principles of good software engineering and stresses program clarity. We are educators who teach leading-edge topics in industry classrooms worldwide. Dr. Harvey M. Deitel has 20 years of college teaching experience and 18 years of industry teaching experience. Paul Deitel has 16 years of industry teaching experience. The Deitels have taught courses at all levels to government, industry, military and academic clients of Deitel & Associates.

Live-Code Approach. AJAX, Rich Internet Applications and Web Development for Programmers is loaded with "live-code" examples—each new concept is presented in the context of a complete working web application that is immediately followed by one or more screen captures showing the application's functionality. This style exemplifies the way we teach and write about programming; we call this the "live-code approach."

Syntax Shading. We syntax shade all the code, similar to the way most integrated-development environments and code editors syntax color code. This improves code readability—an important goal, given that this book contains about 18,000 lines of code in complete, working programs. Our syntax-shading conventions are as follows:

comments appear in italic
keywords appear in bold italic
PHP, Ruby, ASP.NET, JSP delimiters and errors appear in bold black

constants and literal values appear in bold gray
all other code appears in black

Code Highlighting. We place white rectangles around each program's key code segments.

Using Fonts for Emphasis. We place the key terms and the index's page reference for each defining occurrence in bold italic text for easier reference. We emphasize on-screen components in the

bold Helvetica font (e.g., the

File menu) and emphasize program text in the

Lucida font (e.g.,

int x = 5).

Web Access. All of the source-code examples for AJAX, Rich Internet Applications and Web Development for Programmers are available for download from:

www.deitel.com/books/ajaxfp/

Site registration is quick, easy and free. Download all the examples, then run each program as you read the corresponding text discussions. Making changes to the examples and seeing the effects of those changes is a great way to enhance your Internet and web programming learning experience.

Objectives. Each chapter begins with a statement of objectives. This lets you know what to expect and gives you an opportunity to determine if you have met the objectives after reading the chapter.

Quotations. The learning objectives are followed by quotations. Some are humorous; some are philosophical; others offer interesting insights. We hope that you enjoy relating the quotations to the chapter material.

Outline. The chapter outline helps you approach the material in a top-down fashion, so you can anticipate what is to come and set a comfortable learning pace.

Illustrations/Figures. Abundant charts, tables, line drawings, programs and program output are included.

Programming Tips. We include programming tips to help you focus on important aspects of program development. These tips and practices represent the best we have gleaned from a combined six decades of programming and teaching experience. One of our readers told us that she feels this approach is like the highlighting of axioms, theorems and corollaries in mathematics books—it provides a basis on which to build good software.

Good Programming Practices. Good Programming Practices call attention to techniques that will help you produce programs that are clearer, more understandable and more maintainable. 3.0

Common Programming Errors. Programmers tend to make certain kinds of errors frequently. Pointing out these Common Programming Errors reduces the likelihood that you'll make the same mistakes. 3.0

Error-Prevention Tip. These tips contain suggestions for exposing bugs and removing them from your programs; many describe aspects of programming that prevent bugs from getting into programs in the first place. 3.0

Performance Tip. These tips highlight opportunities for making your programs run faster or minimizing the amount of memory that they occupy. 3.0

Portability Tip. We include Portability Tips to help you write code that will run on a variety of platforms and to explain how to achieve a high degree of portability. 3.0

Software Engineering Observation. The Software Engineering Observations highlight architectural and design issues that affect the construction of software systems, especially large-scale systems.

Thousands of Index Entries. We have included an extensive index which is especially useful when you use the book as a reference.

"Double Indexing" of Live-Code Examples. For every source-code program in the book, we index the figure caption both alphabetically and as a subindex item under "Examples." This makes it easier to find examples using particular features.AJAX, Rich Internet Applications and Web Development for Programmers Software Downloads and Additional Resources

Many Internet and web development tools are available. We wrote AJAX, Rich Internet Applications and Web Development for Programmers using Internet Explorer 7, Firefox 2 and other free-for-download software. Links to additional resources and software downloads are available in our Internet and Web programming related Resource Centers:

www.deitel.com/resourcecenters.html/

and at the website for this book:

www.deitel.com/books/ajaxfp/Deitel® Buzz Online Free E-mail Newsletter

Each week, the free Deitel® Buzz Online newsletter announces our latest Resource Center(s) and includes commentary on industry trends and developments, links to free articles and resources from our published books and upcoming publications, product-release schedules, errata, challenges, anecdotes, information on our corporate instructor-led training courses and more. It's also a good way for you to keep posted about issues related to AJAX, Rich Internet Applications and Web Development for Programmers. To subscribe, visit

www.deitel.com/newsletter/subscribe.htmlThe Deitel Online Resource Centers

Our website, www.deitel.com, provides scores of Resource Centers on various topics including programming languages, software, Web 2.0, Internet business and open source projects. The Resource Centers have evolved out of the research we do to support our books and business endeavors.We've found many exceptional resources including tutorials, documentation, software downloads, articles, blogs, podcasts, videos, code samples, books, e-books and more. Most of them are free. In the spirit of Web 2.0, we share these resources with the worldwide community. Each week we announce our latest Resource Centers in the Deitel® Buzz Online (www.deitel.com/newsletter/subscribe.html).

Read More Show Less

Table of Contents

Preface xix Before You Begin xxxiPart 1: Introduction 1Chapter 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

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 66Chapter 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:
12.1 Introduction 348
12.2

12.3 Structuring Data 351
12.4

12.5 Document Type Definitions (DTDs) 361
12.6 W3C

12.7

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

13.6 Using

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 451Chapter 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

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 568Chapter 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
Read More Show Less

Preface

...the challenges are for the designers of these applications: to forget what we think we know about the limitations of the Web, and begin to imagine a wider, richer range of possibilities. It's going to be fun.
--Jesse James Garrett, Adaptive Path
"Ajax: A New Approach to Web Applications"
(adaptivepath.com/ideas/essays/archives/000385.php)

Introduction

Welcome to Internet and web programming andWeb 2.0! And welcome to a walkthrough of the Web 2.0 phenomenon from the technical, business and social perspectives. We've worked hard to create what we hope you'll find to be an informative, entertaining and challenging learning experience. At Deitel & Associates, we write programming language professional books and textbooks for Prentice Hall, deliver corporate training worldwide and developWeb 2.0 Internet businesses. This book reflects today's Web 2.0, Ajax-based, Rich Internet Application-development methodologies.

The technologies you'll learn here are appropriate for experienced professionals who build substantial information systems. You'll find "industrial-strength" code examples. We have attempted to write in a clear and straightforward manner using best practices. Perhaps most important, the book presents hundreds of working code examples and shows the outputs produced when these examples are rendered in browsers or run on computers. We present all concepts in the context of complete working programs.We call this the "live-code approach." All of the source code is available for download from

www.deitel.com/books/ajaxfp/

under the heading "Download Code Examples and Other Premium Content for Registered Users," once you've registered and logged on to our site.

The early chapters present a carefully paced introduction to "client-side" web programming, using the popular JavaScript language and the closely related technologies of XHTML (Extensible HyperText Markup Language), CSS (Cascading Style Sheets) and the DOM (Document Object Model). The material in the JavaScript chapters presents a solid foundation for the deeper treatment of scripting in the Adobe Flash, Adobe Flex, PHP and Ruby on Rails chapters later in the book. Experienced programmers will read the early chapters quickly and find the treatment of scripting in the later chapters to be rigorous and challenging.

Today's users are accustomed to desktop applications with rich graphical user interfaces (GUIs), such as those used on Apple's Mac OS X systems, Microsoft Windows systems, various Linux systems and more. Users want applications that employ the multimedia capabilities of graphics, images, animation, audio and video. They want applications that can run on the Internet and the web and communicate with other applications.

Users want to apply database technologies for storing and manipulating their business and personal data. They want applications that are not limited to the desktop or even to some local computer network, but that can integrate Internet and web components, and remote databases. Programmers want to use all these capabilities in a truly portable manner so that applications will run without modification on a variety of platforms.

In this book, we present a number of powerful software technologies that will enable you to build these kinds of systems. Early in the book we focus on building the portions of web-based applications that reside on the client side (i.e., the portions of applications that typically run in web browsers such as Mozilla's Firefox or Microsoft's Internet Explorer), using technologies such as the XHTML, JavaScript, CSS, Flash, Flex and Extensible Markup Language (XML). Later in the book we concentrate on using technologies such as web servers, databases, PHP, Ruby on Rails, ASP.NET, ASP.NET Ajax and JavaServer Faces (JSF) to build the server side of web-based applications. These portions of applications typically run on "heavy-duty" computer systems on which organizations' business-critical websites reside. By mastering the technologies in this book, you'll be able to build substantial web-based, client/server, database-intensive, "multitier" applications.

If you have questions as you read this book, send an e-mail to deitel@deitel.com--we'll respond promptly. For updates on the book and the status of all supporting software, and for the latest news on Deitel publications and services, visit www.deitel.com. Sign up at www.deitel.com/newsletter/subscribe.html for the free Deitel® Buzz Online e-mail newsletter and check out www.deitel.com/ResourceCenters.html for our growing list of Internet and web programming, Internet business, Web 2.0 and related Resource Centers. Each week we announce our latest Resource Centers in the newsletter.

Key Features

Here's some of the key features of Ajax, Rich Internet Applications and Web Development for Programmers:

  • Reflects today's Web 2.0, Ajax-based, Rich Internet Application-development methodologies.
  • Coverage of the two leading web browsers--Internet Explorer and Firefox. All client-side applications in the book run correctly on both browsers.
  • Focus on Web 2.0 technologies and concepts.
  • Chapter on Web 2.0 and Internet Business (reviewed by leaders in the Web 2.0 community).
  • Focus on building Rich Internet Applications with the interactivity of desktop applications.
  • Chapter on building Ajax-enabled web applications with "raw" Ajax and with the Dojo JavaScript libraries. Applications in this chapter demonstrate partial-page updates and type-ahead capabilities.
  • Chapter on Adobe Flex--a Rich Internet Application framework for creating scalable, cross-platform, multimedia-rich applications for delivery within the enterprise or across the Internet.
  • Chapter on rapid applications development of database-driven web applications with Ruby on Rails; also discusses developing Ajax applications with the Prototype and Script.aculo.us libraries.
  • Two chapters on Adobe Flash CS3, including building a computer game.
  • Significant treatment of client-side scripting with JavaScript.
  • Significant treatments of XHTML DOM manipulation and JavaScript events.
  • Significant treatment of XML DOM manipulation with JavaScript.
  • Chapter on building SOAP-based web services with Java and REST-based web services with ASP.NET (using Visual Basic).
  • Chapter on PHP 5.
  • Coverage of ASP.NET, featuring ASP.NET Ajax.
  • JavaServer Faces (JSF) coverage emphasizing building Ajax-enabled JSF applications.
  • Client-side case studies that enable you to interact with preimplemented serverside applications and web services that we host at test.deitel.com.
  • Case studies including Deitel Cover Viewer (JavaScript/DOM), Address Book
  • (Ajax), Cannon Game (Flash), Weather/Yahoo! Maps Mashup (Flex), Mailing List (PHP/MySQL), Message Forum and Flickr Photo Viewer (Ruby on Rails), Guest Book and Secure Books Database (ASP.NET), Address Book with Google Maps (JavaServer Faces) and Blackjack (JAX-WS web services).

All of this has been carefully reviewed by a team of 38 distinguished industry developers and academics.

AJAX, Rich Internet Applications and Web Development for Programmers Architecture

This book focuses on Web 2.0 and Rich Internet Application (RIA) development. Our goal is to develop webtop applications that have the responsiveness, look and feel of traditional desktop applications. Deitel & Associates, Inc. has evolved into a development organization, while continuing its focus on programming languages textbook and professional book authoring, and corporate training. We're building the infrastructure for the Internet businesses we're designing and developing as part of our Web 2.0 Internet Business Initiative. This book includes discussions of many practical issues we've encountered in developing that infrastructure.

The book is divided into several parts. Chapter 1 introduces Web 2.0 from the technical, business and social perspectives, and provides a foundation for understanding Rich Internet Application development. If you are a serious web developer, you'll want to test your web applications across many browsers and platforms. The examples for the book execute correctly on both Microsoft's Internet Explorer 7 (IE7) and Mozilla's Firefox 2 (FF2) browsers. Most of the examples will also work in other browsers such as Opera and Safari, but may not work on earlier browsers. Microsoft Windows users should upgrade to IE7 and install Firefox; readers with other operating systems should install Firefox.

The second part of the book, Chapters 2–13, presents a detailed treatment of Ajax component technologies, including a comprehensive treatment of JavaScript that spans nine chapters and concludes with Chapter 13's treatment of Ajax development. Ajax is not a new technology--we've been writing about all but one of its component technologies since 1999, and many of the technologies existed before that. However, Ajax is one of the key technologies of Web 2.0 and RIAs. Chapters 2–13 cover "raw" Ajax programming, where you'll handle the details yourself--several later chapters in the book demonstrate technologies that encapsulate Ajax functionality to help you easily build Ajax-based applications that operate across a wide variety of browsers and browser versions without your having to be concerned with the low-level details.

The third part of the book, Chapters 13–24, focuses on both the client and server sides of the GUI and the graphical part of RIA development. Here we cover client-side technologies such as Adobe Flash and Adobe Flex that use, or can be combined with, Ajax or Ajax-like capabilities to develop RIAs. Each of these technologies also can consume web services. Next, we present the server side of web application development with discussions of web servers (IIS and Apache), databases, server-side scripting languages such as PHP and Ruby on Rails, and several server-side frameworks such as ASP.NET 2.0 and Java-Server Faces. We complete our server-side discussion with a chapter on building both SOAP-based and REST-based web services.

You may have noticed that Chapter 13, Ajax-Enabled Rich Internet Applications, overlaps the second and third parts of the book. Chapter 13 serves as a bridge from "raw" Ajax development to "encapsulated" Ajax development with the Dojo libraries.

Teaching Approach

AJAX, Rich Internet Applications and Web Development for Programmers contains a rich collection of examples. The book concentrates on the principles of good software engineering and stresses program clarity. We are educators who teach leading-edge topics in industry classrooms worldwide. Dr. Harvey M. Deitel has 20 years of college teaching experience and 18 years of industry teaching experience. Paul Deitel has 16 years of industry teaching experience. The Deitels have taught courses at all levels to government, industry, military and academic clients of Deitel & Associates.

Live-Code Approach. AJAX, Rich Internet Applications and Web Development for Programmers is loaded with "live-code" examples--each new concept is presented in the context of a complete working web application that is immediately followed by one or more screen captures showing the application's functionality. This style exemplifies the way we teach and write about programming; we call this the "live-code approach."

Syntax Shading. We syntax shade all the code, similar to the way most integrated-development environments and code editors syntax color code. This improves code readability--an important goal, given that this book contains about 18,000 lines of code in complete, working programs. Our syntax-shading conventions are as follows:

comments appear in italic
keywords appear in bold italic
PHP, Ruby, ASP.NET, JSP delimiters and errors appear in bold black
constants and literal values appear in bold gray
all other code appears in black

Code Highlighting. We place white rectangles around each program's key code segments.

Using Fonts for Emphasis. We place the key terms and the index's page reference for each defining occurrence in bold italic text for easier reference. We emphasize on-screen components in the bold Helvetica font (e.g., the File menu) and emphasize program text in the Lucida font (e.g., int x = 5).

Web Access. All of the source-code examples for AJAX, Rich Internet Applications and Web Development for Programmers are available for download from:

www.deitel.com/books/ajaxfp/

Site registration is quick, easy and free. Download all the examples, then run each program as you read the corresponding text discussions. Making changes to the examples and seeing the effects of those changes is a great way to enhance your Internet and web programming learning experience.

Objectives. Each chapter begins with a statement of objectives. This lets you know what to expect and gives you an opportunity to determine if you have met the objectives after reading the chapter.

Quotations. The learning objectives are followed by quotations. Some are humorous; some are philosophical; others offer interesting insights. We hope that you enjoy relating the quotations to the chapter material.

Outline. The chapter outline helps you approach the material in a top-down fashion, so you can anticipate what is to come and set a comfortable learning pace.

Illustrations/Figures. Abundant charts, tables, line drawings, programs and program output are included.

Programming Tips. We include programming tips to help you focus on important aspects of program development. These tips and practices represent the best we have gleaned from a combined six decades of programming and teaching experience. One of our readers told us that she feels this approach is like the highlighting of axioms, theorems and corollaries in mathematics books--it provides a basis on which to build good software.

Good Programming Practices. Good Programming Practices call attention to techniques that will help you produce programs that are clearer, more understandable and more maintainable. 3.0

Common Programming Errors. Programmers tend to make certain kinds of errors frequently. Pointing out these Common Programming Errors reduces the likelihood that you'll make the same mistakes. 3.0

Error-Prevention Tip. These tips contain suggestions for exposing bugs and removing them from your programs; many describe aspects of programming that prevent bugs from getting into programs in the first place. 3.0

Performance Tip. These tips highlight opportunities for making your programs run faster or minimizing the amount of memory that they occupy. 3.0

Portability Tip. We include Portability Tips to help you write code that will run on a variety of platforms and to explain how to achieve a high degree of portability. 3.0

Software Engineering Observation. The Software Engineering Observations highlight architectural and design issues that affect the construction of software systems, especially large-scale systems.

Thousands of Index Entries. We have included an extensive index which is especially useful when you use the book as a reference.

"Double Indexing" of Live-Code Examples. For every source-code program in the book, we index the figure caption both alphabetically and as a subindex item under "Examples." This makes it easier to find examples using particular features.

AJAX, Rich Internet Applications and Web Development for Programmers Software Downloads and Additional Resources

Many Internet and web development tools are available. We wrote AJAX, Rich Internet Applications and Web Development for Programmers using Internet Explorer 7, Firefox 2 and other free-for-download software. Links to additional resources and software downloads are available in our Internet and Web programming related Resource Centers:

www.deitel.com/resourcecenters.html/

and at the website for this book:

www.deitel.com/books/ajaxfp/

Deitel® Buzz Online Free E-mail Newsletter

Each week, the free Deitel® Buzz Online newsletter announces our latest Resource Center(s) and includes commentary on industry trends and developments, links to free articles and resources from our published books and upcoming publications, product-release schedules, errata, challenges, anecdotes, information on our corporate instructor-led training courses and more. It's also a good way for you to keep posted about issues related to AJAX, Rich Internet Applications and Web Development for Programmers. To subscribe, visit

www.deitel.com/newsletter/subscribe.html

The Deitel Online Resource Centers

Our website, www.deitel.com, provides scores of Resource Centers on various topics including programming languages, software, Web 2.0, Internet business and open source projects. The Resource Centers have evolved out of the research we do to support our books and business endeavors.We've found many exceptional resources including tutorials, documentation, software downloads, articles, blogs, podcasts, videos, code samples, books, e-books and more. Most of them are free. In the spirit of Web 2.0, we share these resources with the worldwide community. Each week we announce our latest Resource Centers in the Deitel® Buzz Online (www.deitel.com/newsletter/subscribe.html).

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)