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

  • Home
  • SEARCH
  • 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 6777643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:10:21+00:00 2026-05-26T16:10:21+00:00

The Tweet Button is usually: <a href=https://twitter.com/share class=twitter-share-button data-count=horizontal data-via=someone>Tweet</a> <script type=text/javascript src=//platform.twitter.com/widgets.js></script> and

  • 0

The Tweet Button is usually:

<a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="someone">Tweet</a>
<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>

and here I can get a callback when the user tweets:

<script>
  twttr.events.bind('tweet', function(event) {
    console.log(event);
  });
</script>

What I don’t understand: how does twitter give me this callback? The tweet is done in another window and from another domain. How is this possible?

  • 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-26T16:10:21+00:00Added an answer on May 26, 2026 at 4:10 pm

    From what I can gather this is Twitters own implementation of Web Intents which is a Web API loosely based on Androids Intents functionality. It looks like that Twitter are using a JavaScript implementation of Web Intents (possibly similar to this).

    In this scenario, the Twitter JavaScript registers an intent with the browser. The intent being you sharing a URL. When the user clicks the tweet button the intent activity is started and a new pop-up windows is displayed.

    The user clicks the tweet button from the pop-up window and the browser posts back the event data to a callback specified when starting the activity. The callback is specified in the widget.js and you hook up to this event using the twttr.events.bind method.

    There is a really good example of how this works on the JavaScript github implementation of WebIntents.

    Usage

    To use today

    No browsers currently support this API natively. To use this system
    simple drop the following code in to your site:

    <script src="http://webintents.org/webintents.min.js"></script>
    

    When browsers start to implement this natively the Shim will defer all
    its functionality to the native interface.

    Declaration

    To register your service application to be able to handle image
    sharing simply declare an intent tag.

    <intent 
      action="http://webintents.org/share"
      type="image/*" />
    

    This will register the current page’s ability to share images.

    Invocation

    To build a client application that can use the share functionality, it
    is as simple as using the following code:

    var intent = new Intent(
        "http://webintents.org/share", 
        "image/*", 
        "http://upload.wikimedia.org/wikipedia/commons/thumb/f/f8/Three_jolly_kittens.png/800px-Three_jolly_kittens.png"
    
    );
    window.navigator.startActivity(intent);
    

    Service

    When a service is invoked via startActivity, the “intent” object on
    window will be populated with the data provided by the client.

    window.intent
    

    That’s it.

    To send data back to the client that invoked it, it is as simple as
    calling postResult() on the intent.

    window.intent.postResult("something cool");
    

    The example is obviously slightly different to the Twitter implementation but the general process is the same.

    Here are few other references for the WebIntents API:

    • Chromium Project – Web Intents
    • Another Example of how WebIntents is used from the Chromium blog
    • Twitter Web Intents API Documentation
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've added the tweet button (https://dev.twitter.com/docs/tweet-button) to my website and I'm trying to determine
I was trying a tweet button with this script and html code. <script src=//platform.twitter.com/widgets.js
I'm going to add a Twitter Tweet button - http://twitter.com/about/resources/tweetbutton - to some pages
I have a very simple bit of jQuery to retrieve my latest Tweet $.getJSON(http://twitter.com/statuses/user_timeline/username.json?count=1,
I am using both the twitter tweet button, and the facebook like button <a
I'm trying to add facebook like button and twitter tweet button on a list,
${test} <c:forEach items= ${test} var=sharedType> ${sharedType}<br/> <c:if test=${sharedType == 2} > <span class=tweet-button></span> </c:if>
I'm looking into using the Twitter tweet button API, found: here I have the
I am using Twitter's own Tweet button on a page that I display in
I'm having problems with the Tweet button. Here is the code that Twitter provides:

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.