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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:56:54+00:00 2026-05-25T13:56:54+00:00

The Facebook JS SDK has the equivalent of jQuery’s trigger() function, FB.Event.fire that allows

  • 0

The Facebook JS SDK has the equivalent of jQuery’s trigger() function, FB.Event.fire
that allows you to trigger the handlers you attach for particular events. Its helpful for my unit tests in QUnit. It works basically as you’d expect it to; FB.Event.fire("comment.create", location.href); fires my handlers for the comment.create event.

Twitter’s object for Web Intents, twttr appears to have something that looks like it could be similar, twttr.events.trigger(), but its undocumented.

Except, I can’t figure out how to trigger it correctly in code, without it throwing an error.

How can I programmatically test the handlers that I attach to this object?

For code like:

twttr.events.bind("click", function(intent){
    console.dir(intent);
});

I’d expect to be able to trigger it by doing something like: twttr.events.trigger("click")

Everything I try results in an error, and I’m not able to decipher the obfuscated source code.

I’ve put up some basic code on the JSFiddle: http://jsfiddle.net/YL6SN/

  • 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-25T13:56:54+00:00Added an answer on May 25, 2026 at 1:56 pm

    Hello Yahel nice question,

    It should work if you call this:

    twttr.events.trigger("click", {});
    

    It expects a second parameter that is the object that is passed back to your callback. When it happens naturally this object is populated with other parameters

    {target: b,region: "intent",type: "click",data: {}}
    

    If you pass an empty object like I proposed it will work as well but in your callback you receive the object only with the type property since this is added by the trigger.

    And that was exactly the error you triggered when you don’t pass a second parameter. It tries to add the type parameter to undefined and and then dies.

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

Sidebar

Related Questions

Microsoft recently announced their Facebook SDK. http://msdn.microsoft.com/en-us/windows/ee388574.aspx Has anyone tried using it with ASP.NET
Does Twitter has the iPhone SDK which has a login popup like facebook iOS
Working on a project that has a website and a Facebook page. They both
I am working on simple facebook integration that allows users to post high scores
I been listening around that facebook iOS sdk is not functioning properly. Is there
In Facebook's Compose Message, each name that appears in the TO field uses a
My Facebook application contains Javascript that works in Firefox and IE, but aborts in
I have looked on FaceBook Developer page and found that it's possible to create
I'm trying to access the Facebook API Admin.getMetrics method via jQuery. I'm correctly composing
I'm using the Facebook Connect for iPhone SDK at http://github.com/facebook/facebook-iphone-sdk/ and am trying to

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.