开发者

What is alternative to jQuery(this) in YUI 3?

I have started coding in yui and already have good knowledge of jQuery ,

I need some information about migrating f开发者_如何学JAVArom jQuery to yui.

What is the alternative to jQuery(this) in YUI?


In most cases, jQuery(this) is done inside event callbacks to wrap the subscribed element with the jQuery API. In YUI3, that's done for you automatically. The this in event callbacks is the Node instance that was subscribed from.

Y.one('#readygo').on('click', function (e) {
    this.append("<p><code>this</code> is already a YUI 3 wrapped Node instance.</p>");
});


You may find JS Rosettastone useful. I found it invaluable when I moved to YUI 3 and I will not move back.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜