| Page 1 of 1 | [ 5 posts ] |
|
Hi,
I discovered YUI today and am battling to get past something in the tutorials that must be so obvious to everyone else that it isn't documented anywhere that's easy to find for a beginner: What goes before Code: (function() { ... }); })(); </script> I expect that it is some variation on: Code: <script type="text/javascript" src="http://yui.yahooapis.com/2.9.0/build/yuiloader/yuiloader-min.js"></script> YUI().use('node', function(Y) {..... I have been able to get the first couple of pages in the tutorial working but I can't find documentation on the crucial missing piece anywhere, so I keep getting either a blank page, a "YAHOO is undefined" or an "onDomReady is undefined" error message, depending on the permutation tried. The example I am trying to get working is at http://developer.yahoo.com/yui/examples/layout/panel_layout.html I'd also be very grateful if you could point me to where I could have found this crucial insight on my own - if you know where! Thanks very much. Gary |
|
You are mixing YUI versions up there. There was no YUI().use() in YUI 2.9, that came in YUI3.
In YUI 2 there was no built-in 'sandbox', that is, a place you can play without risk. That strange anonymous self-executing function provides a local environment where you can declare anything you want and it does not get mixed up with global variables. Now, that was in YUI2. In YUI3, the YUI().use() needs a function as the last argument to use() and that one automatically provides the sandbox. If you use YUI3, then you will get YAHOO is undefined since the global instance in YUI3 is called YUI, not YAHOO and, anyway, you would not need it. and onDomReady is undefined because it is call onDOMReady, and that's YUI2. Anyway, first, settle for YUI2 or YUI3 and don't get those two mixed up. |
Juan Ignacio DopazoYUI Contributor
|
Hey Gary! I think your biggest problem is that you're looking at documentation for an old version of the library. Ignore http://developer.yahoo.com/yui/. That's there mostly for legacy content.
My recommendation is for you to follow these steps: * Start with the Quick Start guide http://yuilibrary.com/yui/quick-start/ * Then have a look at the User Guides for the main components: Node and Event. * And finally take a look at the YUI3 Panel User Guide |
|
Thanks, Satyam. I wonder if I'm the only one who has been confused by this as a result o trying to hack something together very quickly. If so fine - my bad! If not, I wonder if it's worth finding a way to make it easier for noobs to diagnose or realise?
In any event, the delay in getting my message posted has brought me to implement jQuery UI Layout - with excellent support from the developer Kevin. I may return to YUI at some point for some other goodies I really like... |
|
Thank, Juan. As I've commented to Satyam, the delay in getting my posting - and perhaps yours - approved has meant that I've gone with jQuery UI Layout for this project. Kevin's support is excellent, as I said.
I may come back to YUI at some point. Thanks for the advice. Gary |
| Page 1 of 1 | [ 5 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group