Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
|New from||Used from|
See the Best Books of 2018 So Far
Looking for something great to read? Browse our editors' picks for the best books of the year so far in fiction, nonfiction, mysteries, children's books, and much more.
About the Author
If you buy a new print edition of this book (or purchased one in the past), you can buy the Kindle edition for only $2.99 (Save 89%). Print edition purchase must be sold by Amazon. Learn more.
For thousands of qualifying books, your past, present, and future print-edition purchases now lets you buy the Kindle edition for $2.99 or less. (Textbooks available for $9.99 or less.)
Top customer reviews
There was a problem filtering reviews right now. Please try again later.
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.
Dan Wellman clearly knows the YUI. I had a problem with one of his examples, and sent an email to the publisher. Dan replied with an answer and later responded to direct questions. It is refreshing to find an author who will communicate with the reader on that level,
I found this book to be a good introduction to the Yahoo User Interface with examples on its use. However, it is lacking detailed information on the classes and their methods. Having said that, Yahoo has done a good job of giving the world a decent open source library that makes many of the tedious tasks less painful. Dan Wellman has done a good job on giving us a look into how to utilize a portion of this library.
This book is a good investment for any serious web developer.
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.
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.
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.
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.
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.