This is a short one. On the Pixie landing page I was trying to use jQuery to focus on a game embedded via an iFrame. I tried
$ -> $('iframe').contents().find('canvas').focus()
but that didn’t work.
It turns out to get this working you need setTimeout. I guess the browser isn’t done loading the iFrame contents by the time jQuery says the DOM is ready.
$ -> setTimeout -> $('iframe').contentWindow.focus() , 100
Here’s the related Stack Overflow question