Get Web Intent Callback from a call


Wonder if anyone can help. See attached code below:

  • If I launch a Web Intent via a normal “a href”, and then tweet I get the callback. Lovely.

  • If, however, I launch a Web Intent via a, say from a button click, I don’t. See code below.

  • I could, trap the button click, and then call click on the “a href”. At this point, I do then get the callback. However, this action in some browsers (e.g. Safari) gets caught in the pop-up blocker, so no-one sees the popup. Which is a bit useless.

I would like to use the approach, and get the callback. Any thoughts anyone?

***** START OF CODE ******

<!doctype html>
<html lang="en">
<head lang=en>
	<meta charset="utf-8">
	<title>Web Intent t3 Experiment</title>
	<script src=""></script>
	<script src="" type="text/javascript"></script>

<a href=" web intents">Option 1: Tweet via Link</a><br />
<button id="tf_sendtweet_button">Option 2: Tweet Via Button and JS</button>
<script type="text/javascript">
var t_element ="#tf_sendtweet_button");
t_element.on("click", function() {
		_text = "Some compelling text to go in a tweet";
		_url = "";

		var tweet_url = '';
		tweet_url += encodeURIComponent(_text);
		tweet_url += '&url=' + encodeURIComponent(_url);,'_blank');

// Here, trap the callback from the WebIntent.
twttr.ready(function (twttr) {
	// bind events here'tweet', function (event) {
		alert("Yay, tweet callback baby. Gotcha.");
		console.log(new Date(), "Sweett, tweet callback: ", event);

***** END OF CODE ******


Unfortunately you can’t use the callback events features without letting our javascript control the window opening.


Oh. Poot. Well that settles that one. Quelle domage.
Thanks for answering so quickly though.