Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6895211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:52:47+00:00 2026-05-27T06:52:47+00:00

I would like to register a custom utility / module within YUI3 that is

  • 0

I would like to register a custom utility / module within YUI3 that is passed one or more custom node(s) and that can be called like this (without having to instantiate it):

YUI().use('myCustomModule', function (Y) {
 Y.one('nodeToProcess').myCustomUtility(config);
 Y.all('manyNodes').myCustomUtility(config);
});

jQuery offers a similar functionality.

I know that a custom module in YUI3 is defined like this:

YUI.add('myCustomModule', function(Y) {
// my Code here
}, '0.1', {
requires : ['node']
});

But what I don’t understand is how to setup my custom module, so that I can call it like described. Do I have to extend Plugin / Widget class or use Y.Namespace() to get this to work? (see http://www.slideshare.net/caridy/building-yui-3-custom-modules )

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:52:48+00:00Added an answer on May 27, 2026 at 6:52 am

    You may want to try this:

    <!doctype html>
    <head>
        <meta charset="utf-8">
        <script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script>
        <script>
    YUI.add('joiz', function(Y) {
    
        function joizMagic(context, config) {
            alert(config.name + ' says: "' + this.getContent() + '"');
        }
    
        // define a function that will run in the context of a
        // Node instance:
        Y.Node.addMethod("joizMagic", joizMagic);
    
        // extend this functionality to NodeLists:
        Y.NodeList.importMethod(Y.Node.prototype, "joizMagic");
    
    }, '0.1.1' /* module version */, {
        requires: ['node']
    });
    YUI().use('joiz', function (Y)
    {
        Y.all('.message').joizMagic({ name: 'Beatrice' });
    });
        </script>
    </head>
    <body>
        <div class="message">Hello World!</div>
        <div class="message">I'm still here!</div>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have php scripts that do things like register, login, upload. I would like
I have a class that implements multiple interfaces. I would like to register these
I've a website where users can register. I would like to prevent all special
I would like to create a custom WPF control that inherits from comboBox. So
I have a custom dependency property that I would like to use as a
I would like to do some analysis on top of my custom protocol that
Problem Language: C# 2.0 or later I would like to register context handlers to
I would like to convert this fluent approach to xml: container.Register( AllTypes.FromAssemblyNamed(Company.DataAccess) .BasedOn(typeof(IReadDao<>)).WithService.FromInterface(), AllTypes.FromAssemblyNamed(Framework.DataAccess.NHibernateProvider)
Would like to make anapplication in Java that will not automatically parse parameters used
I have a custom control Workspace that inherits from Control and within it is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.