AJAX, Rich Internet Applications, and Web Development 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"

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 youre finished, youll 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.

Author(s): Paul J. Deitel
Edition: 1
Publisher: Prentice Hall PTR
Year: 2008

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

AJAX, Rich Internet Applications, and Web Development for Programmers......Page 1
Contents......Page 10
Preface......Page 20
Before You Begin......Page 32
Part 1: Introduction......Page 34
1 Dive Into® Web 2.0......Page 35
1.1 Introduction......Page 36
1.2 What Is Web 2.0?......Page 37
1.3 Search......Page 40
1.4 Content Networks......Page 45
1.5 User-Generated Content......Page 46
1.6 Blogging......Page 49
1.7 Social Networking......Page 52
1.8 Social Media......Page 56
1.9 Tagging......Page 59
1.10 Social Bookmarking......Page 61
1.11 Software Development......Page 62
1.12 Rich Internet Applications (RIAs)......Page 65
1.13 Web Services, Mashups, Widgets and Gadgets......Page 67
1.14 Location-Based Services......Page 70
1.15 XML, RSS, Atom, JSON and VoIP......Page 71
1.16 Web 2.0 Monetization Models......Page 72
1.17 Web 2.0 Business Models......Page 74
1.18 Future of the Web......Page 77
1.19 Where to Go for More Web 2.0 Information......Page 81
1.20 Web 2.0 Bibliography......Page 82
1.21 Web 2.0 Glossary......Page 89
Part 2: The Ajax Client......Page 99
2 Introduction to XHTML......Page 100
2.1 Introduction......Page 101
2.3 First XHTML Example......Page 102
2.5 Headings......Page 105
2.6 Linking......Page 106
2.7 Images......Page 109
2.8 Special Characters and Horizontal Rules......Page 112
2.9 Lists......Page 114
2.10 Tables......Page 117
2.11 Forms......Page 121
2.12 Internal Linking......Page 128
2.13 meta Elements......Page 131
2.14 Web Resources......Page 132
3 Cascading Style Sheets™ (CSS)......Page 133
3.1 Introduction......Page 134
3.2 Inline Styles......Page 135
3.3 Embedded Style Sheets......Page 136
3.4 Conflicting Styles......Page 139
3.5 Linking External Style Sheets......Page 142
3.6 Positioning Elements......Page 144
3.7 Backgrounds......Page 148
3.8 Element Dimensions......Page 149
3.9 Box Model and Text Flow......Page 151
3.10 Media Types......Page 155
3.11 Building a CSS Drop-Down Menu......Page 157
3.12 User Style Sheets......Page 159
3.14 Web Resources......Page 163
4 JavaScript: Introduction to Scripting......Page 164
4.1 Introduction......Page 165
4.2 Simple Program: Displaying a Line of Text in a Web Page......Page 166
4.3 Modifying Our First Program......Page 169
4.4 Obtaining User Input with prompt Dialogs......Page 174
4.6 Arithmetic......Page 180
4.7 Decision Making: Equality and Relational Operators......Page 181
4.8 Web Resources......Page 185
5 JavaScript: Control Statements I......Page 186
5.2 Control Statements......Page 187
5.3 if Selection Statement......Page 188
5.4 if…else Selection Statement......Page 189
5.5 while Repetition Statement......Page 193
5.6 Counter-Controlled Repetition......Page 194
5.7 Formulating Algorithms: Sentinel-Controlled Repetition......Page 196
5.8 Formulating Algorithms: Nested Control Statements......Page 199
5.9 Assignment Operators......Page 202
5.10 Increment and Decrement Operators......Page 203
5.11 Web Resources......Page 206
6 JavaScript: Control Statements II......Page 207
6.2 Essentials of Counter-Controlled Repetition......Page 208
6.3 for Repetition Statement......Page 210
6.4 Examples Using the for Statement......Page 214
6.5 switch Multiple-Selection Statement......Page 218
6.6 do…while Repetition Statement......Page 223
6.7 break and continue Statements......Page 225
6.8 Labeled break and continue Statements......Page 228
6.9 Logical Operators......Page 230
6.10 Web Resources......Page 235
7 JavaScript: Functions......Page 236
7.2 Program Modules in JavaScript......Page 237
7.4 Function Definitions......Page 238
7.5 Random Number Generation......Page 243
7.6 Example: Game of Chance......Page 248
7.7 Another Example: Random Image Generator......Page 255
7.8 Scope Rules......Page 256
7.9 JavaScript Global Functions......Page 259
7.10 Recursion......Page 260
7.11 Recursion vs. Iteration......Page 263
7.12 Web Resources......Page 264
8 JavaScript: Arrays......Page 265
8.2 Arrays......Page 266
8.3 Declaring and Allocating Arrays......Page 267
8.4 Examples Using Arrays......Page 268
8.5 Random Image Generator Using Arrays......Page 275
8.6 References and Reference Parameters......Page 276
8.7 Passing Arrays to Functions......Page 277
8.8 Sorting Arrays......Page 280
8.9 Multidimensional Arrays......Page 282
8.10 Building an Online Quiz......Page 286
8.11 Web Resources......Page 288
9 JavaScript: Objects......Page 289
9.2 Introduction to Object Technology......Page 290
9.3 Math Object......Page 293
9.4 String Object......Page 294
9.5 Date Object......Page 305
9.6 Boolean and Number Objects......Page 310
9.7 document Object......Page 311
9.8 window Object......Page 312
9.9 Using Cookies......Page 317
9.10 Multipage HTML and JavaScript Application......Page 321
9.11 Using JSON to Represent Objects......Page 329
9.12 Web Resources......Page 330
10 Document Object Model (DOM): Objects and Collections......Page 331
10.2 Modeling a Document: DOM Nodes and Trees......Page 332
10.3 Traversing and Modifying a DOM Tree......Page 335
10.4 DOM Collections......Page 346
10.5 Dynamic Styles......Page 348
10.6 Summary of the DOM Objects and Collections......Page 354
10.7 Web Resources......Page 355
11 JavaScript: Events......Page 356
11.2 Registering Event Handlers......Page 357
11.3 Event onload......Page 360
11.4 Event onmousemove, the event Object and this......Page 361
11.5 Rollovers with onmouseover and onmouseout......Page 366
11.6 Form Processing with onfocus and onblur......Page 371
11.7 Form Processing with onsubmit and onreset......Page 374
11.8 Event Bubbling......Page 376
11.9 More Events......Page 378
11.10 Web Resources......Page 379
12 XML and RSS......Page 380
12.2 XML Basics......Page 381
12.3 Structuring Data......Page 384
12.4 XML Namespaces......Page 391
12.5 Document Type Definitions (DTDs)......Page 394
12.6 W3C XML Schema Documents......Page 398
12.7 XML Vocabularies......Page 405
12.8 Extensible Stylesheet Language and XSL Transformations......Page 409
12.9 Document Object Model (DOM)......Page 418
12.10 RSS......Page 435
12.11 Web Resources......Page 443
13 Ajax-Enabled Rich Internet Applications......Page 444
13.1 Introduction......Page 445
13.2 Traditional Web Applications vs. Ajax Applications......Page 446
13.3 Rich Internet Applications (RIAs) with Ajax......Page 448
13.5 “Raw” Ajax Example Using the XMLHttpRequest Object......Page 450
13.6 Using XML and the DOM......Page 456
13.7 Creating a Full-Scale Ajax-Enabled Application......Page 460
13.8 Dojo Toolkit......Page 473
13.9 Web Resources......Page 482
Part 3: Rich Internet Application Client Technologies......Page 484
14 Adobe® Flash® CS3......Page 485
14.1 Introduction......Page 486
14.2 Flash Movie Development......Page 487
14.3 Learning Flash with Hands-On Examples......Page 489
14.4 Publishing Your Flash Movie......Page 505
14.5 Creating Special Effects with Flash......Page 506
14.6 Creating a Website Splash Screen......Page 518
14.8 Web Resources......Page 524
15 Adobe® Flash® CS3: Building an Interactive Game......Page 525
15.1 Introduction......Page 526
15.3 Objects in Flash......Page 528
15.4 Cannon Game: Preliminary Instructions and Notes......Page 530
15.6 Creating Moving Objects......Page 531
15.7 Adding the Rotating Cannon......Page 536
15.8 Adding the Cannonball......Page 538
15.9 Adding Sound and Text Objects to the Movie......Page 541
15.10 Adding the Time Counter......Page 542
15.11 Detecting a Miss......Page 544
15.12 Adding Collision Detection......Page 545
15.13 Finishing the Game......Page 548
15.14 ActionScript 3.0 Elements Introduced in This Chapter......Page 549
16 Adobe® Flex™ 2 and Rich Internet Applications......Page 550
16.1 Introduction......Page 551
16.2 Flex Platform Overview......Page 552
16.3 Creating a Simple User Interface......Page 553
16.4 Accessing XML Data from Your Application......Page 564
16.5 Interacting with Server-Side Applications......Page 578
16.6 Customizing Your User Interface......Page 587
16.7 Creating Charts and Graphs......Page 591
16.8 Connection Independent RIAs on the Desktop: Adobe Integrated Runtime (AIR)......Page 599
16.10 Web Resources......Page 600
Part 4: Rich Internet Application Server Technologies......Page 601
17 Web Servers (IIS and Apache)......Page 602
17.2 HTTP Transactions......Page 603
17.3 Multitier Application Architecture......Page 607
17.4 Client-Side Scripting versus Server-Side Scripting......Page 608
17.6 Microsoft Internet Information Services (IIS)......Page 609
17.7 Apache HTTP Server......Page 614
17.8 Requesting Documents......Page 616
17.9 Web Resources......Page 617
18 Database: SQL, MySQL, ADO.NET 2.0 and Java DB......Page 618
18.1 Introduction......Page 619
18.2 Relational Databases......Page 620
18.3 Relational Database Overview: A books Database......Page 621
18.4 SQL......Page 624
18.6 Instructions for Installing MySQL......Page 633
18.7 Instructions for Setting Up a MySQL User Account......Page 634
18.9 ADO.NET Object Model......Page 635
18.11 Web Resources......Page 637
19 PHP......Page 639
19.1 Introduction......Page 640
19.2 PHP Basics......Page 641
19.3 String Processing and Regular Expressions......Page 651
19.4 Form Processing and Business Logic......Page 656
19.5 Connecting to a Database......Page 663
19.6 Using Cookies......Page 667
19.7 Dynamic Content......Page 673
19.8 Operator Precedence Chart......Page 682
19.9 Web Resources......Page 684
20 Ruby on Rails......Page 685
20.2 Ruby......Page 686
20.3 Rails Framework......Page 693
20.4 ActionController and ActionView......Page 695
20.5 A Database-Driven Web Application......Page 698
20.6 Case Study: Message Forum......Page 703
20.7 Script.aculo.us......Page 724
20.8 Web Resources......Page 732
21 ASP.NET 2.0 and ASP.NET Ajax......Page 733
21.1 Introduction......Page 734
21.2 Creating and Running a Simple Web Form Example......Page 735
21.3 Web Controls......Page 749
21.4 Session Tracking......Page 770
21.5 Case Study: Connecting to a Database in ASP.NET......Page 786
21.6 Case Study: Secure Books Database Application......Page 798
21.7 ASP.NET Ajax......Page 826
21.8 Web Resources......Page 830
22 JavaServer™ Faces Web Applications......Page 831
22.1 Introduction......Page 832
22.2 Java Web Technologies......Page 833
22.3 Creating and Running a Simple Application in Netbeans......Page 836
22.4 JSF Components......Page 853
22.5 Session Tracking......Page 866
22.6 Web Resources......Page 889
23 Ajax-Enabled JavaServer™ Faces Web Applications......Page 891
23.1 Introduction......Page 892
23.2 Accessing Databases in Web Applications......Page 893
23.3 Ajax-Enabled JSF Components......Page 905
23.4 AutoComplete Text Field and Virtual Forms......Page 906
23.5 Google Maps Map Viewer Component......Page 914
23.6 Web Resources......Page 923
24 Web Services......Page 924
24.1 Introduction......Page 925
24.3 Creating, Publishing, Testing and Describing a Web Service......Page 927
24.4 Consuming a Web Service......Page 938
24.5 SOAP......Page 947
24.6 Session Tracking in Web Services......Page 948
24.7 Consuming a Database-Driven Web Service from a Web Application......Page 964
24.8 Passing an Object of a User-Defined Type to a Web Service......Page 972
24.9 REST-Based Web Services in ASP.NET......Page 982
24.10 Web Resources......Page 993
A......Page 995
B......Page 997
C......Page 998
D......Page 1000
E......Page 1002
F......Page 1005
G......Page 1006
H......Page 1007
I......Page 1008
L......Page 1009
M......Page 1010
N......Page 1012
P......Page 1013
R......Page 1015
S......Page 1016
T......Page 1019
U......Page 1020
W......Page 1021
X......Page 1023
Z......Page 1024