Home > Store

AJAX, Rich Internet Applications, and Web Development for Programmers

Register your product to gain access to bonus material or receive a coupon.

AJAX, Rich Internet Applications, and Web Development for Programmers

Book

  • Sorry, this book is no longer in print.
Not for Sale

Description

  • Copyright 2008
  • Dimensions: 7" x 9-1/8"
  • Pages: 1032
  • Edition: 1st
  • Book
  • ISBN-10: 0-13-158738-2
  • ISBN-13: 978-0-13-158738-0

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

Sample Content

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

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020