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 8044157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:08:18+00:00 2026-06-05T05:08:18+00:00

I use the dojo 1.7 version, I want to bind user-defined event, in jQuery

  • 0

I use the dojo 1.7 version, I want to bind user-defined event, in jQuery I can do like this:

$(window).bind("pushMessage",function(){});

then trigger the event like this:

$(window).trigger("pushMessage",{});

Can dojo get the same result like above? If yes, how?

  • 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-06-05T05:08:20+00:00Added an answer on June 5, 2026 at 5:08 am

    Yes, it can via dojo/on:

    on(window, "pushMessage", function(event) {});
    
    on.emit(window, "pushMessage", {
        bubbles: true,
        cancelable: true
    });
    

    See it in action: http://jsfiddle.net/phusick/MQThM/

    There is also dojo/Evented which provides a class that can be used as a base class or mixin for JavaScript classes that emit their own events. An example from documentation:

    require([
        "dojo/_base/declare",
        "dojo/Evented"
    ], function(
        declare,
        Evented
    ) {
    
        var MyComponent = declare([Evented], {
            startup: function() {
                this.emit("ready", {});
            }            
        });
    
        var component = new MyComponent();
        component.on("ready", function() {
            console.log("Component is ready.");        
        });
    
        component.startup();
    
    });​
    

    Also at jsFiddle to play with: http://jsfiddle.net/phusick/ZhG58/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use Dojo dnd Source(1.4.2) to create an interface where I can
In jQuery I would do: var foo = jQuery(form); foo.each(function(){ this.find(.required).each(function(){...}) }) This would
How do I use jQuery with Dojo toolkit? I've heard of both libraries being
I want to use dojo doxox/dtl in AMD, OUTSIDE OF A WIDGET! Currently (2012-02-10)
I'd like to do something like this: dojo.place(this.message.subject, this.apSubject); But it throw exception in
I'm starting to use Dojo; this is (essentially) my introduction to AJAX. We have
Can I use Dojo in an business application free of cost?
What's the intent behind a framework like Dojo or jQuery Mobile in the context
I would like to use a Dojo button to download an Excel or a
I want to use org.wicketstuff.dojo.markup.html.form.DojoDatePicker an so I am searching over internet for maven

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.