Search the web
Sign In
New User? Sign Up
yui3 · YUI 3.x Discussion Forum
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
General YUI3 Brokenness   Message List  
Reply | Forward Message #364 of 927 |
Hello all, 

I'm trying to prototype using YUI3 on an existing website that already makes extensive usage of YUI 2.6. I'm running into some problems with fundamental brokenness in YUI3 that seems too broken to be attributable to the release being a preview. Can anyone tell me if they're having similar problems and if not, speculate as to what might be broken in my environment? I'm developing on OS X, FF 3.0.5, Firebug 1.2.1. I'm a relative JS noob, so comments/suggestions on how to clean up my code would be most appreciated. My setup is as follows:

First, I've included YUI in the header of my page: 

<script type="text/javascript" src="http://yui.yahooapis.com/combo?3.0.0pr2/build/yui/yui-debug.js&3.0.0pr2/build/oop/oop-debug.js&3.0.0pr2/build/event/event-debug.js&3.0.0pr2/build/dom/dom-debug.js&3.0.0pr2/build/node/node-debug.js"></script>

I attempted to instantiate YUI on an as-needed basis as shown in the docs (i.e. YUI.use('node', function(Y) { ... })), however that just didn't seem to work for me at all (basic methods like ".get(<String>)" just weren't there), so I made a global YUI object as follows:

<script type="text/javascript">
myYUI3 = YUI({debug: true, filter: 'debug'});
myYUI3.use('console',function(Y) { });
</script>

Then, in a .js file I include in the page, I use the object as follows:

myYUI3.use('io-base','io-form',function(Y) {
//Code here
};

I noticed a lot of weird behavior, so I investigated on the Firebug console. Among other things, I found:
-query() selectors are not scoped appropriately. For example,
tmp = Y.get('#compose_pane'); //tmp is now a DIV that contains a form 
myForm = tmp.query(".compose_form"); //WRONG!
//myForm is another FORM element of the same CSS class but not the one within the tmp element!

-No attributes are available on YUI Nodes
myForm = Y.get('form.compose_form'); //A form element I'm going to post use io-form
cfg = {
form: { id: myForm },
... //Rest skipped for clarity
};
Y.io(url,cfg); //ERROR: io method calls myForm.elements which is undefined

I'm especially stuck on the second problem as I can't find a workaround...  Thoughts?  

Thanks,

Logan Bowers





Wed Jan 7, 2009 2:56 am

l0g4nb
Offline Offline
Send Email Send Email

Forward
Message #364 of 927 |
Expand Messages Author Sort by Date

Hello all,  I'm trying to prototype using YUI3 on an existing website that already makes extensive usage of YUI 2.6. I'm running into some problems with ...
l0g4nb
Offline Send Email
Jan 7, 2009
2:56 am

... src="http://yui.yahooapis.com/combo?3.0.0pr2/build/yui/yui-debug.js&3.0.\ ... 0pr2/build/oop/oop-debug.js&3.0.0pr2/build/event/event-debug.js&3.0.0pr2\ ......
tssha
Online Now Send Email
Jan 7, 2009
6:50 pm

Hi Thomas, Thanks for the quick reply. I'm pretty excited to be using YUI3; the syntax is great and the libraries have are more feature-rich than I expected....
Logan Bowers
l0g4nb
Offline Send Email
Jan 7, 2009
9:36 pm

... It does not yet support nodes. ... Any response data returned to the event handler will be specific to that transaction. While the responses may be...
tssha
Online Now Send Email
Jan 8, 2009
5:29 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help