Alright, here’s the situation.
I’ve got the Youtube API working to upload a video. Once it is uploaded, it returns http://example.com/?status=200&id=3-1234xyz.
Ideally, I’d like to have this submitted and uploaded via Ajax and then have the ID returned to immediately display on the page (that will eventually show the URL or embed code for the video). I’m using jquery, but I’m at my whits end with all of this. Any and all help, links, etc are greatly appreciated!
Use an iframe. You simply post the file upload form into the iframe, when it’s then finished loading (you can capture this event with $(‘#iframe’).ready( … )) you can then capture the video id (cos it’s on the same domain).
So your upload form will be along the following lines:
And then all your iframe needs to do is just pass the video id up to the parent (or you can read it from the parent, but I prefer the former):
And job done 😀