Book Image

Yahoo User Interface Library 2.x Cookbook

By : Matt Snider
Book Image

Yahoo User Interface Library 2.x Cookbook

By: Matt Snider

Overview of this book

<p>The Yahoo! User Interface (YUI) Library is a set of utilities and controls, written in JavaScript, for building richly interactive web applications using techniques such as DOM scripting, DHTML, and AJAX. Although you can create stylish Internet applications by modifying its default components, even advanced users find it challenging to create impressive feature-rich Internet applications using YUI.</p> <p>This book will help you learn how to use YUI 2.x to build richer, more interactive web applications that impress clients and wow your friends. It has recipes explaining over twenty-five YUI components, showing how to use them, and how to configure them to meet your needs. Each covered component will have extractable code samples that showcase the common ways that the component is used.</p> <p>The book starts by explaining the core features of YUI 2.x, the utilities that the rest of the library depends on and that will make your life easier. It then explains how to build UI components and make AJAX requests using the YUI framework. Each recipe will cover the most common ways to use a component, how to configure it, and then explain any other features that may be available. We wrap things up by looking at some of the recent beta components and explain how to use them, and how they may be useful on your web application.</p> <p>For each of the recipes, there is an introductory example, then more advanced examples, followed by an explanation of how the component works and what YUI is doing. For more experienced developers, most recipes also include additional discussion of the solution, explaining to further customize and enhance the component.</p>
Table of Contents (22 chapters)
Yahoo! User Interface 2.x Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Welcome to Yahoo! User Interface 2.x Cookbook. The Yahoo! User Interface (YUI) Library is a set of utilities and controls, written in JavaScript, for building richly interactive web applications using techniques such as DOM scripting, DHTML, and AJAX. Although you can create stylish Internet applications by modifying its default components, even advanced users find it challenging to create impressive feature-rich Internet applications using YUI.

This book will help you learn how to use YUI 2.x to build richer, more interactive web applications that impress clients and wow your friends. It starts by explaining the core features of YUI 2.x, the utilities that the rest of the library depends on and that will make your life easier. It then explains how to build UI components and make AJAX requests using the YUI framework. Each recipe will cover the most common ways to use a component and how to configure it, and then explain any other features that may be available. We wrap things up by looking at some of the recent beta components and explain how to use them, and how they may be useful on your web application.

What this book covers

Chapter 1: Using YUI 2.x, teaches various techniques for including YUI into your project, and how to use the Get, Cookie, and JSON utilities.

Chapter 2: Using Dom and Selector Components, teaches how to use the DOM and Selector components to fetch and manipulate DOM elements.

Chapter 3: Using Event Component, teaches how to attach events to DOM elements and how to use the powerful custom event system to create your own events.

Chapter 4: Using Connection Component, teaches how to make AJAX requests with YUI and subscribe to related events.

Chapter 5: Using DataSource Component, teaches how to abstract away sources of data with a powerful and easy to use interface.

Chapter 6: Using Logger and YUI Test Components, teaches how to use YUI to log JavaScript and then how to test your JavaScript applications.

Chapter 7: Using Element and Button Components, teaches how to leverage Element to simplify working with DOM elements, and Button to simplify working with Button elements.

Chapter 8: Using Menu Component, teaches how to create and manage Menu objects.

Chapter 9: Using Animation Component, teaches how to use YUI to animate DOM elements.

Chapter 10: Using Drag and Drop Component, teaches how to use the Drag and Drop utility.

Chapter 11: Using Container Component, teaches all about the container stack and the various widgets that make use of it.

Chapter 12: Using DataTable Component, teaches how to use DataTable to build more useful and interactable tables.

Chapter 13: Using TreeView Component, teaches how to use TreeView to organize hierarchical data.

Chapter 14: Other Useful Components, teaches the basics about some of the other well established widgets, such as Autocomplete and Slider.

Chapter 15: Some Interesting Beta Components, teaches the basics about some of the latest widgets, such as Storage and Charts.

What you need for this book

You should have a good understanding of JavaScript, and some experience with HTML and CSS. Having some knowledge of server-side programming may help with a few examples that leverage the Connection component.

Who this book is for

This book is intended for anyone who wants to improve their websites and online applications using the most powerful JavaScript library available. You should be able to walk away from each recipe with practical experience to be applied on your own projects.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "Each of the components in the build folder will contain at least three JavaScript files."

A block of code is set as follows:

var loader = new YAHOO.util.YUILoader({
/* Insert Options Here */
});

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "A namespace is simply a JavaScript object whereon you can organize a component or related components".

Note

Warnings or important notes appear in a box like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book — what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Note

Downloading the example code for this book

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books — maybe a mistake in the text or the code — we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.