harry
harry

Reputation: 220

Twitter callback Web Intents Javascript Events

Is it possible to pass some variables to the called function,

it tried it like this but failed

<script type="text/javascript">
twttr.ready(function (twttr) {
twttr.events.bind('tweet', twitnshare('tws_likings', '<?php echo $sess_uid;?>', href));
});</script>

If its not possible, whats the way out.

Upvotes: 1

Views: 4705

Answers (2)

MallickB
MallickB

Reputation: 69

Usually if the events binding is not working i have found ppl missing the assign to windows.twttr before binding an event to it. First do this :

window.twttr = (function (d,s,id) {
  var t, js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;
  js.src="https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);
  return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });
}(document, "script", "twitter-wjs"));

Than do the bindings:

twttr.ready(function (twttr) {
twttr.events.bind('tweet', function (event) { //add ur post tweet stuff here } );
});

Following links might help : https://dev.twitter.com/docs/intents/events#events

https://dev.twitter.com/discussions/671

Upvotes: 2

chanian
chanian

Reputation: 51

Question answered in place on our dev forums: https://dev.twitter.com/discussions/671

Upvotes: 0

Related Questions