Learning the Yahoo! User Interface library and over one million other books are available for Amazon Kindle . Learn more


or
Sign in to turn on 1-Click ordering.
or
Amazon Prime free trial required. Sign up when you check out. Learn more
More Buying Choices
Have one to sell? Sell yours here
Learning the Yahoo! User Interface Library (YUI)
 
 
Start reading Learning the Yahoo! User Interface library on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Learning the Yahoo! User Interface Library (YUI) [Paperback]

Dan Wellman
4.0 out of 5 stars  See all reviews (2 customer reviews)
RRP: £27.99
Price: £26.59 & this item Delivered FREE in the UK with Super Saver Delivery. See details and conditions
You Save: £1.40 (5%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In stock.
Dispatched from and sold by Amazon.co.uk. Gift-wrap available.
Want guaranteed delivery by Friday, June 1? Choose Express delivery at checkout. See Details

Formats

Amazon Price New from Used from
Kindle Edition £14.00  
Paperback £26.59  
Amazon.co.uk Trade-In Store
Did you know you can trade in your old books for an Amazon.co.uk Gift Card to spend on the things you want? Plus, get an extra £5 Gift Certificate when you trade in books worth £10 or more before June 30, 2012. Visit the Books Trade-In Store for more details.

Product details

  • Paperback: 359 pages
  • Publisher: PACKT PUBLISHING (28 Mar 2008)
  • Language English
  • ISBN-10: 1847192327
  • ISBN-13: 978-1847192325
  • Product Dimensions: 23.5 x 19 x 2 cm
  • Average Customer Review: 4.0 out of 5 stars  See all reviews (2 customer reviews)
  • Amazon Bestsellers Rank: 831,208 in Books (See Top 100 in Books)
  • See Complete Table of Contents

More About the Author

Dan Wellman
Discover books, learn about writers, and more.

Visit Amazon's Dan Wellman Page

Product Description

Product Description

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. The YUI Library also includes several core CSS resources. All components in the YUI Library have been released as open source under a BSD license and are free for all uses.

This book covers all released components whether utility, control, core file, or CSS tool. Methods of the YAHOO Global Object are used and discussed throughout the book.
The basics of each control will be presented, along with a detailed example showing its use to create complex, fully featured, cross-browser, Web 2.0 user interfaces.

Besides giving you a deep understand of the YUI library, this book will expand your knowledge of object-oriented JavaScript programming, as well as strengthen your understanding of the DOM and CSS.

You will learn to create a number of powerful JavaScript controls that can be used straight away in your own applications.

About the Author

Dan Wellman lives with his wife and three children in his home town of Southampton on the south coast of England. By day his mild-mannered alter-ego works for a small yet accomplished e-commerce production agency. By night he battles the forces of darkness and fights for truth, justice, and less intrusive JavaScript. He has been writing computer-related articles, tutorials, and reviews for around five years and is rarely very far from a keyboard of some description.

Inside This Book (Learn More)
Browse Sample Pages
Front Cover | Copyright | Table of Contents | Excerpt | Index | Back Cover
Search inside this book:

Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
 
(1)
(1)

Your tags: Add your first tag
 

What Other Items Do Customers Buy After Viewing This Item?


Customer Reviews

5 star
0
3 star
0
2 star
0
1 star
0
Most Helpful Customer Reviews
6 of 6 people found the following review helpful
Format:Paperback
The Yahoo! User Interface Library sits comfortably amongst its peers, which include Prototype, jQuery and Mootools amongst many others. Arguably it can be said that the YUI library is the king among the JavaScript and CSS-libraries. With a vast number of well documented examples and near 100% compatibility amongst modern browsers, it would be difficult to find a comparable library.

It is one thing to be a well documented library, but it is another to know how to use the libraries to construct a user interface. This is the niche Dan Wellman fills with his book. Although not necessarily for the beginner, since you need a knowledge of CSS, JavaScript and a little AJAX, Wellman does a good job of explaining the concepts, especially AJAX, from scratch.

Wellman provides an A-to-Z of the library and assumes, rightly, that the reader has little or no knowledge of the library. To that effect, he does a long introduction of the YUI, following an overall review of its components, listing them in the first chapter. He then picks up a selection of some of the most established utilities, for example navigation, animation and AJAX utilities and in the following chapters he covers one or two examples for each of them.

Importantly, the book teaches the reader how to not only use the DOM manipulation and event handling aspects of the library, but also the CSS tools of the library.

Wellman does a good job of introducing the technical aspects at the beginning of each chapter, but not dwelling too long before moving on to real usage and methods.

What I would have liked to have seen is more interaction between different components written about in the book. Clearly building a fully-featured application that incorporates most or all of the key components would be unweildy, but individual and isolated examples doesn't equate real-world scenarios either. For example, it is quite conceivable that autocomplete and drag-and-drop components would be utilised on the same page; it would have been good if Wellman had explained the pains or pitfalls that may be encountered with such combinations. The negativity aside, the examples are of a good quality.

The book does contain a number of errors, but since this is the first edition you can probably forgive the editors from missing them.

A major gripe I have with this book, indeed all technical books is the lack of colour throughout. It is far easier to read and understand the example code when code colouring is employed, allowing for easier understanding of the key elements in the code. Surely modern publishing techniques can mitigate against the extra cost of colour. Indeed, I would pay more for a well-written coloured technical book.

A great summary chapter on graceful degredation versus progressive enhancement would also have been welcomed, since many developers may not consider the usability and accessibility issues of using JavaScript.

This book is certainly a good read for anyone who has basic knowledge of JavaScript, HTML and CSS and who wants to learn how to apply the YUI library in their projects, making them more interactive for the user.
Comment | 
Was this review helpful to you?
4 of 4 people found the following review helpful
Format:Paperback
This book was an enjoyable and factual read.
This was my first experience of a PACKT book. They are not quite as polished an outfit as the likes of Manning or Pragmatic Bookshelf.
* I noticed three or four obvious spelling mistakes.
* My book seemed to have a manufacturing flaw whereby pages 1-76 were included twice!
There were also numerous download packaging issues:
* From my emails with Dan it emerged a last minute change occurred so that the last chapter 10 became chapter 4. Consequently there is an off by one discrepancy. Chapter 5's code is in 4 of download, 6 is in 5 .... 10 is in 9 etc.
* Also there was an issue with the dialogs.html (P245-267) in Chapter 8 making a reference to a non existent mymenu.css that prevented the example from working correctly. There were discrepancies between book & code download on CSS ordering as well as the way labels for radio buttons were nested within the form.
* There were non-existent resources in other places too:
** buttons.html Ch6 of book. Reference to non existent terms and contents
** Ch8: P279 : Tabbed control: Missing gcard.gif
** Ch9: Drag & Drop basket. No images folder.
*** Was able to copy img1-3 from Ch8 and call them prod1-3
*** However corresponding...._ico.jpg images weren't provided. So:
**** P299 - 302, (dragdropbasket_easy.html) and P308, (dragdropbasket.html) have missing resource and page doesn't display nicely.
* The installation instructions weren't very clear cut:
** The book describes creating a 'yuisite' folder and nesting a 'yui' folder inside it that contains all of the artifacts from downloading the YUI library itself.
** I found it easier to copy the source code folders themselves into yuisite. As a result all the css link and javascript link imports didn't work.
*** It would have been prudent it the author had prefixed these imports with '../' or '../../' depending on the folder depth.
*** The nested zips were a bit of a pain too. I'd have preferred it if the nested folders had been left expanded.

Dan was a good guy to correspond with. I appreciated his pro-active nature and timely reponses. He informs me they will fix the packaging issues.

The code uses PHP for the back end server stuff. I'd have preferred to have seen Java and servlets, but the code was easy to follow.

I would have liked to have seen an example of the DataTable control. But because this wasn't out of beta it didn't get included in the book.

I wasn't too impressed with the way auto generated id's were used to wire up events on the context menu on page 210. I think this was a rather brittle implementation. Luckily the YUI examples provides a better approach. (I'm not sure if the addItem method allows an id to be specified in the signature. It would have been a better way to go. Maybe there is a DOM method or setAttribute method somewhere that could do this).

This brings me on to what I feel is an inherent weakness of YUI compared to say Prototype. I prefer passing optional arguments using name-value pairs with intelligent defaults. YUI forces you to learn the argument sequencing. It also doesn't have any of the nice array processing capabilities like 'for each' compared to Prototype either.

Ive also seen CSS handled more elegantly within Dojo. The code given uses Hacks to get around browser variances rather than adding a browser tag to the CSS Selector.

There was some good stuff going on in YUI with the normalisation of layouts across browswers with CSS. But there was one final gripe surrounding this area for me. It was the cryptic lettered naming convention of the placeholders baked into YUI for the multi-column content. I hated how unintuitive it was. I'd have preferred col_3_40_20_40 for three columns 40%, 20%, 40% or something to this effect instead. These get utilised to create CSS stylesheets for template layouts.

With the negative issues out of the way, the book and the YUI library itself had way more positive points. It covered such topics as:
* Calendar controls including how to maintain bookmarkable state for Ajax controls using BHM.
* DOM manipulation. Some nice enhancements here not found in other JavaScript libraries. Shame about array processing though.
* Event model processing. Observer type pattern with Listeners. Continuity across browsers. Fixes IE problems.
* AJAX Connection manager. Nice abstraction here.
* Animation. Cool stuff here involving how to move objects using Bezier curves.
* Buttons. Useful additions here. As well as providing continuity of style across browsers, allows for buttons to do what you'd normally do with radio button groups or drop down lists.
* Treeview
* Menus. Great implementations. Easy to use. Vertical menus and Context Menus, similar to a regular desktop application. Also horizontal menus that load from left out. Vertical and Horizontal menus allow submenus. Similar to HTML Dog menus, but much easier to implement.
* Autocomplete
* Accordion. Not as good as some implementations I've seen, but quite good.
* Tabbed Pages, Panels and Dialogs (Modal Forms), CSS styled Tooltips.
* Basic shopping cart Drag & Drop example. Cool implementation with Proxies to speed up event handling.
* Rounds out with overview of Logging class. No more nasty debugging alerts.

I liked the way YUI didn't pollute the Global namespace with the namespace construct. Important when you want to work with multiple Ajax libraries and more so when you work on really large projects with the potential for naming clashes.

I think the book gives a good foundation in YUI, but only scratches the surface of capabilities the library has to offer. Try doing a Google search on `YUI Design Pattern Library' to see what other controls are on offer.
Comment | 
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com:  12 reviews
11 of 11 people found the following review helpful
Well-titled book 3 Jun 2008
By R. Bunyan - Published on Amazon.com
Format:Paperback|Amazon Verified Purchase
The Yahoo! User Interface (YUI) library is arguably the best JavaScript- and CSS-based collection of tools and controls for web development. The YUI team has carefully tested them on all modern browser platforms to assure near 100% compatibility across them all. They provide excellent documentation, both online and downloadable. And it's all free Open Source.

However, while each component is well documented with text and examples, there remains a need of putting it all together. This book fulfills that need in part. Admittedly, a single application that incorporates a large number of examples would be too complex to follow, but I would have liked to see more interaction. The book is riddled with errors. Most of them, fortunately, are so obvious that you wonder how they escaped an editor.

Dan Wellman is a Brit. His wry British sense of humor makes the book a pleasure to read.
11 of 11 people found the following review helpful
YUI Distilled 1 Jun 2008
By Nathan Smith - Published on Amazon.com
Format:Paperback
I recently read Learning the Yahoo! User Interface Library, written by Dan Wellman. I had been interested in learning more about YUI for awhile now, and this book was a great way to digest all that documentation, distilled. I have to say, after 30 days of using the JavaScript portion of YUI, and with the help of Wellman's book, I have taken quite a liking to it. For the purposes of this review, I will highlight a few of the things I like about YUI, and how the book brought those to light.

Ubiquity

Wellman covers some of the practical business reasons that one might consider using YUI. The code library is extremely well tested, put through its paces by roughly 3.4 billion page views per day on Yahoo's own sites. Their incentive to maintain reliable code quality is paramount.

In addition to being free to use, YUI is also generously hosted by Yahoo, meaning that you can link directly to their servers. The benefits here are twofold. First, it saves you the bandwidth cost of hosting the files yourself. Perhaps more importantly, it means if you link directly to their code, there is a high likelihood it will already be cached on a user's computer. Since it's already downloaded, this increases the perceived responsiveness of your site.

As major companies are hot-linking to the YUI files hosted by Yahoo (remember, it's permissible in this case), that means their visitors are potentially loading the same components needed by your site. This makes for a powerful, world-wide, redundant distribution hub.

Document Object Model

Wellman then explains how traversing the DOM can be streamlined. YUI augments built-in JS methods like getElementsByTagName and getElementById, with functions like getElementsByClassName and the powerful "get," which can be made to retrieve just about anything imaginable. There are also numerous methods by which you can target the children or ancestors of any element.

Events

The mark of any good library is the ability to add progressive enhancement via unobtrusive methods. Buzz words aside, that simply means that we keep our HTML clean of any unsightly behavioral markup. Wellman shows how this might have looked in the sites of yesteryear, and explains the better way to do it today, both via longhand JavaScript and in the YUI syntax.

The nice thing about using YUI is that is normalizes events across multiple browsers. This means that the incorrect implementations of Internet Explorer are abstracted from you, and you're able to focus more on crafting the interaction, instead of worrying about obscure bugs. As I said previously, that has been battle tested already, by the numerous visitors to Yahoo's sites.

There are three main ways to attach events: onDOMReady, onAvailable and onContentReady. Rather than waiting for the window.onload event to fire, which is dependent on all image downloads to finish, you can instead begin to interact with the document as soon as the HTML is loaded. The other two let you check for the readiness of a particular element, firing a function as a result.

Animation

Wellman briefly explains how animations work in YUI, and shows some of the implications for rich interactivity. Those familiar with Flash will appreciate the way that animations are defined, with start to end points, and tweening configurations in between. Wellman touches on this briefly, which is sufficient enough to get one's mind racing about the potential possibilities. Coupled with the getX, getY and getXY methods included in the util.Dom core, this leaves the door wide open for some seriously cool effects.

Another nice thing about getStyle, setStyle and util.Anim is that they all normalize the opacity property. Depending on the browser, different CSS must be applied. With YUI, you can change these on the fly, creating fade effects.

Ajax

The Connection Manager and History components are both very robust, but Wellman breaks them down into understandable chunks. Connection Mgr. allows you to define trigger events for Ajax calls, success and failure states, as well as callback functions to be fired when various things happen. History allows for you to create faux application states, so that a user can bookmark where they're at, even though it might not be a "real" URL. Additionally, this ensures that the back button continues to work as expected. Wellman explains how these work in tandem.

Drag + Drop

Wellman explains drag + drop adeptly. One can even specify boundaries beyond which an element cannot be dragged. For instance, restricting the viewport, to prevent an unintentional horizontal scrollbar via dragging an element outside the viewable area.

Conclusion

I hope that I have whet your appetite to learn more about YUI, and would highly suggest this read as a starting point. There are even entire CSS components to normalize fonts, grids, and build complex user interfaces. All of these topics are thoroughly documented by Wellman. Anyone looking to master a powerful client-side code library should definitely consider YUI, and this book.
6 of 6 people found the following review helpful
Great Book on YUI Library 2 Aug 2008
By Frank Stepanski - Published on Amazon.com
Format:Paperback
The Yahoo! User Interface Library is a free resource provided by Yahoo! for web developers. It's a collection of utilities that enable developers to build cross-browser web applications quickly and easily. This library has been around for a few years now and is very extensive. It contains utilities, components, controls (widgets), and CSS tools. This can be very confusing for the developer who has no previous experience with using these types of tools. Even though Yahoo! has some very good online documentation, it still can be difficult to get started using some of these many online tools.

Dan Wellman really explains the main core components of YUI Library very well and would be very helpful to anybody wanting to quickly get started using the YUI.

Dan starts off with a great overview of YUI, with some simple examples. Then in the next chapter (2), the author goes into the CSS tools that it provides to help the develop create consistent web pages of layout and design. The next chapter (3), explains many of the DOM and Event manipulation classes that are provided. This is a very useful chapter because many web pages that use JavaScript require manipulation of web elements on the page. Using many the DOM methods in YUI make it very easy to access any element on a web page.

Continuing with the book, Dan then focuses on the Ajax and Connection Manager classes. Ajax has almost become the defacto-standard of displaying and access data on a web page and using classes explained in this chapter make it very easy to understand many of the useful examples the author use such as a log-in page, newsreaders, etc. I was able to following along very easily and create similar examples based upon the author's explanations.

The rest of the book goes into many of the other useful classes such as: Animation, Buttons, Navigation Trees, Content Containers, and Drag-andDrop, and Auto-complete. You can create almost any type of web interface from the components that are explained from this great book.

If there is one library you use, it should be the YUI Library because it is backed by Yahoo! so you know it is not going anywhere and fully tested and this should be your book that you buy to truly understand it.

A great buy!
Search Customer Reviews
Only search this product's reviews

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 

Search Customer Discussions
Search all Amazon discussions
   


Listmania!

Create a Listmania! list

Look for similar items by category


Look for similar items by subject


Feedback


Amazon.co.uk Privacy Statement Amazon.co.uk Delivery Information Amazon.co.uk Returns & Exchanges