capture the click of the Twitter “Tweet” button using jQuery

前端 未结 3 1421
南笙
南笙 2021-01-03 04:02

I have the following code on my site, which when it accesses Twitter\'s API generates it\'s own markup.

I\'m looking to call a JavaScript function on the onCli

3条回答
  •  再見小時候
    2021-01-03 04:40

    You can't handle click events on this element, because it's in an iFrame, however twitter gives you the opportunity to bind events to the button.

    Example: http://jsfiddle.net/ZwHBf/2/ Docs: https://dev.twitter.com/docs/intents/events

    Code: HTML:

    JS:

    twttr.events.bind('click', function(event) {
        console.log('clicked');
    });​
    

提交回复
热议问题