Preface

Web Development with JavaScript and Ajax Illuminated covers the basic concepts, technologies, techniques, and practices for developing Ajax Web applications. This textbook is intended for a one-semester course in web development at the upper undergraduate or graduate level for computer science, information technology, information systems, or other related fields. This text is also an excellent self-study reference for web developers.

The only prerequisite is some programming experience—course-based experience will do. Beyond that, we hope the reader is familiar with the Internet and has created a few web pages. While it would be helpful if the reader has done a little development in PHP and Java, the examples are simple enough for any reader experienced with programming to understand.

Overview

 

This book includes the necessary elements the student needs to start developing web applications with desktop-like user interaction using standard web technologies, such as (X)HTML, CSS, XML, and JavaScript. This book primarily covers client-side web development because that's where Ajax has had the largest impact. This book also includes enough server-side code to allow the student to create full examples.

All the examples in this book use open source or free-to-use software that students can download and install on their computer, including: a modern web browser that supports web standards and JavaScript, Firebug, Dojo, the NetBeans IDE™, PHP, Java™, the Apache web server, the Apache Tomcat Java application server, and the GlassFish Java application server. Source code for all examples is available on the Internet.

Chapter Breakdown

 

Chapter 1: Ajax Defined

In this introductory chapter, we begin with the history of the Internet and the evolution of web page-user interaction. Our discussion of the basics of web architecture includes HTTP messages, HTTP headers, the HTTP request/response model, interaction between the web browser and web server, and what a URL consists of. The Ajax technique—including the technologies involved—is introduced, and the reason behind Ajax popularity is discussed.

Chapter 2: Web Pages Using Web Standards

This is the first of the book's three foundational chapters. In this chapter we cover (X)HTML and CSS so the reader will understand how to use these technologies to create their own web pages. This chapter also provides more detail about HTTP, the difference between GET and POST, and how to use HTML forms.

Chapter 3: XML—the X in Ajax

As the second foundational chapter, Chapter 3 details XML and XSLT. The motivation and importance of XML is discussed, as is how to define XML dialects using DTD and XML Schema. Finally, this chapter covers XML parsing using SAX and DOM, as well as XML transformation using XSLT.

Chapter 4: JavaScript and the Document Object Model

This third foundational chapter covers the JavaScript programming language and the in-memory representation of web pages in a web browser. In our discussion of JavaScript we address the datatypes it supports, its object-oriented features, lexical scoping and closures, built-in functions and objects, embedding in HTML, and a few best practices. This chapter also highlights the objects available in the Browser Object Model (BOM) and the Document Object Model (DOM), as well as how to traverse and manipulate the DOM and styles.

Chapter 5: Web Remoting Techniques—the A in Ajax

In this chapter, students discover the details of incorporating Ajax techniques into a web application, including using the XMLHttpRequest object and the hidden frame technique. The reason for Ajax's fame is the XMLHttpRequest object. XMLHttpRequest provides the capability to make background asynchronous requests to the server and receive responses—asynchronous becomes the A in Ajax. The different data transports, such as HTML, XML, JSON, and plain text, are discussed with examples given throughout the chapter. This chapter also discusses the technique of “pushing” data to the client using HTTP streaming and Ajax pitfalls. Finally, the end of the chapter gives a complete example that uses PHP on the server-side.

Chapter 6: Dojo Toolkit

This chapter outlines the advantages of using a JavaScript library when using the Dojo Toolkit. We focus on the basic usage of the Dojo Toolkit and provide a few complete examples using Java as the server-side language.

Chapter 7: Ajax Challenges and Best Practices

This chapter addresses the technical challenges involved in Ajax development and best practices. It also discusses open source tools to use for testing JavaScript code to ensure the quality of your product. Finally, we concentrate on security concerns with Ajax.

Chapter 8: Ajax Case Study

The purpose of this chapter is to present a website that could benefit from an Ajax solution and then work through a complete design and implementation, demonstrating the decisions made to meet the requirements of what the website wants to offer. JavaScript and Dojo are used on the client-side and Java is used on the server-side. The NetBeans IDE aids the development.

Chapter 9: The Future of Web Applications

This final chapter discusses the future of web applications. It covers the buzzwords Web 1.0, 2.0, and 3.0, and the concept of a semantic web. Additionally, it introduces the next generation of web HTML forms—XForms.

Chapter 10: Appendix

Information regarding downloading, installing, and configuring the tools used throughout the book appear in the Appendix.

Instructor's Materials

The following ancillaries are available online at http://www.jbpub.com/catalog/9780763754891/:

• Answers to the odd-numbered end-of-chapter exercises

• A set of lecture outlines in PowerPoint format

• Source code for all examples given in the chapters

• Test items for each chapter

Acknowledgments

 

Thanks to all those who reviewed this book for their constructive comments, suggestions, and encouragement. We appreciate the hard work and support of the editorial and production teams at Jones and Bartlett Publishers, especially: Tim Anderson, Acquisitions Editor; Melissa Potter, Editorial Assistant; Melissa Elmore, Associate Production Editor; and Kat Macdonald, Production Editor. Kai Qian would also like to thank Therese Albert for his help with the lab work. In particular, we thank our families for their support, patience, and tolerance of the interruption of their vacation plans.

Contacting the Authors

 

We value your questions and comments regarding this book's content and source code examples. We've done our best to ensure that the technical details of this book are accurate. Despite our best efforts there may still be some errors. Please direct all questions and comments to http://computer-science.jbpub.com/ajaxilluminated.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset