开发者

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

开发者 https://www.devze.com 2023-03-24 23:36 出处:网络
I have started coding in yui and already have good knowledge of jQuery , I need some information about migrating f开发者_如何学JAVArom jQuery to yui.

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

精彩评论

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