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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:47:00+00:00 2026-05-28T04:47:00+00:00

Referring to the code below, is there a way to bind the test 2

  • 0

Referring to the code below, is there a way to bind the “test 2” handler to the “my_event” event after “my_event” has occurred so that “test 2” is run right away?

<!DOCTYPE html>
<html>
  <head>
    <title>tests</title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
  </head>
  <body>
    <script type="text/javascript">

      $(document).bind("my_event", function () {
          alert("test 1");
      });

      $(document).trigger("my_event");

      $(document).bind("my_event", function () {
          alert("test 2");
      });

    </script>
  </body>
</html>
  • 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-28T04:47:01+00:00Added an answer on May 28, 2026 at 4:47 am

    Checkout jQuery’s special events. Anytime a "facebookReady" event is added, the add callback will be called, and you can chose to invoke the callback immediately or defer it based on some condition. In this example, I’m looking at the presence of the global FB property to decide whether to invoke it.

    jQuery.event.special.facebookReady = {
        add: function(handleObject) {
            if (window.FB) {
                handleObject.handler.call(this);
            }
        }
    };
    

    Once the special event’s callback is setup, bind the event as you normally would.

    $(document).bind('facebookReady', ..);
    

    Depending on whether FB has loaded on not, it may or may not trigger immediately.

    Checkout an example.

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

Sidebar

Related Questions

Referring to the Configuration Manager under the Build menu, Is there a way to
I'm using the Kal calendar . For the code shown below I'm referring to
How should I change the code below so that Array<Index> array; is enough and
Referring to the model.set() function in backbone.js: Is there a way to supply the
How come unserialize isn't restoring my array? See code below.. // prints a:1:{s:8:txn_type;s:32:recurring_payment_profile_cancel;} echo
I'm referring to the syntax for writing strings in code, including multiline strings and
I am referring to this project by Jimmy Bogard: http://www.codeplex.com/AutoMapper The code repository site
Referring to What is the correct way to make a custom .NET Exception serializable?
I met an interesting issue about C#. I have code like below. List<Func<int>> actions
I've got a Model in Django, example code below (not my actual code): class

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.