I want to know when a tweet is loaded.
I have this kind of post http://pego-design.com/remarky-brisi/media-twitter-embeds/ or here http://en.support.wordpress.com/twitter/twitter-embeds/
and would like to know the height of the strange iframe create by this code :
<div class="entry-content">
<blockquote class="twitter-tweet" width="550"><p>Really cool to read through and find so much awesomeness added to WordPress 3.6 while I was gone. I should take three weeks off more often.</p>
<p>— Andrew Nacin (@nacin) <a href="https://twitter.com/nacin/status/319508408669708289">April 3, 2013</a></p></blockquote>
<p><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script></p>
ugly with js demo : http://jsfiddle.net/qWHc5/2/
If you check this demo, you can see first and final size of the iframe (93,213,213,213⦠or 93,93,93,213,213â¦), I need to know how to get the last value without an ugly solution.
I try this How can I detect whether an iframe is loaded? but doesn’t workâ¦
UPDATE : I found this version of widgets.js https://gist.github.com/johan/4479186 with callbacks I don’t knwo how to use, like this window.twttr.tfw.callbacks.cb0
.
WordPress uses oEmbed to include twitter among others.
You can find the code that does this at
wp-includes/class-oembed.php
To influence it use:
You can place this in you
funtions.php
.This should help you on your way.
Here’s the correct way to check when Twitter is ready:
Late answer but hope this helps future users!