views:

172

answers:

3
+2  Q: 

YUI Hello World

I'm trying to do some experimental stuff for which YUI looks like the best solution. The Getting Started documentation is all written on the assumption that you already know how to use YUI and only need to find out how to use specific components. Is there any documentation available that tells you how to go from an empty public_html directory to some kind of Hello World equivalent in YUI (preferably version 3)?

+5  A: 

YUI is used like you would use any javascript: you need to include the relevant js files in the head section of your html and then write some javascript to tie them together (call the yui methods).

The page source for the simplest yui button example http://developer.yahoo.com/yui/examples/button/btn%5Fexample01%5Fclean.html is probably the best place to start: shows how the head section would look like and what you can do with the button.

laura
Thanks, I looked at the source for that page. The main chunk of Javascript is reasonably clear, but there are five includes at the start and about 15 lines of what looks like line noise at the end; do these depend on what is going to be on the page? If so, how do I obtain equivalents for my own pages?
rwallace
You do not need to look at the noise at the end of that page, that's not part of the example.
Jesper
The includes are needed, yes - they contain the code which defines the yui components. The noise at the back is not needed, the actual example ends (barring the final body/html marks) at the comment "END SOURCE CODE FOR EXAMPLE"
laura
A: 

rwallace -- It's not exactly "Hello World," but "Writing Your First YUI Application" may be worth your time:

http://www.insideria.com/2008/05/writing-your-first-yui-applica.html

Note that this was written a while back, and the dependency tree has changed a little -- grab the latest info from

http://developer.yahoo.com/yui/articles/hosting/?animation&autocomplete&get&json&MIN&norollup

Regards, Eric

Eric Miraglia
A: 

You could do worse than to check out Douglas Crockfords tutorials on Javascript.

See this question

http://stackoverflow.com/questions/11246/best-resources-to-learn-javascript

Toby Allen