Showing posts with label yui. Show all posts
Showing posts with label yui. Show all posts

Thursday, April 24, 2008

Hidden Gems in the YAHOO object

by Eric Miraglia.

Mitch at PlankDesign.com has posted a nice review of one of the least-discussed aspects of YUI Core — the YAHOO Global Object’s YAHOO.lang member. He covers a number of the language conveniences provided therein, including type checking, trim, substitute, later and merge.

Luke Smith from the YUI team recently added some great examples of other features in the YAHOO object, so check those out, too, if you’re interested in learning more about this essential building block of YUI.

Lang's little gems, on PlankDesign.com


Wednesday, April 16, 2008

Global Domination � Yahoo! User Interface Blog

Global Domination � Yahoo! User Interface Blog: "Global Domination
June 1, 2006 at 11:27 am by Douglas Crockford | In Development |

JavaScript, as realized in browsers, is a load-and-go programming language. Programs are delivered to the execution site as text. This is a good fit for the web, which is at its root a text delivery system. The program text is eval‘d, which compiles it into an executable form and then immediately executes it. That execution can leave artifacts in the window’s global object.

The global object is the global namespace that holds the top level functions and global variables. Variables which are not explicitly defined are implied global variables, and their names are also kept in the global object. This was a convenience for the little scripts that Navigator 2 was expected to support. In the decade since NS2, those little scripts have grown into Ajax applications, and the true nature of the global object is revealed:"

Global Domination, Part Two � Yahoo! User Interface Blog

Global Domination, Part Two � Yahoo! User Interface Blog: "Global Domination, Part Two
April 16, 2008 at 1:29 pm by Douglas Crockford | In Development |

As I continue the practice of the craft of programming, I am always examining my practices. Can I improve the patterns that I use so that I can make my programs clearer, stronger, better? This is particularly important when working with a language like JavaScript which has a bias that favors patterns that are confusing, weak, and worse.

One of the worst features of JavaScript is its reliance on global variables.
This can be mitigated with global abatement and the module pattern, which can significantly reduce the number of global variables that we need to declare.

But when we must declare a global variable, how best should we do that?
JavaScript provides three ways of declaring a global variable, and they all
have problems. Which is least worst?"

Monday, April 14, 2008

Rich Text Editing with YUI on Yahoo! Video

Rich Text Editing with YUI on Yahoo! Video: "YUI engineer Dav Glass -- author of the YUI Rich Text Editor -- introduces you to the fundamentals of rich text editing in YUI, including the lightweight Simple Editor and the compelling full Editor. Along the way, he demonstrates the key concepts.."