[wp-hackers] 3.3 media upload API

Steve Taylor steve at sltaylor.co.uk
Thu Nov 10 21:39:17 UTC 2011


Thanks Andrew. I've ended up with this:

$( document ).ajaxComplete( function() {
	[do stuff]
});

Very blunt, but effective. The stuff in there tests what's what in the
DOM and detects if a new media item has been dropped in. Seems to work
OK, though I'll have another crack with your suggestion if I run into
problems with this.

Cheers,

Steve

> Seems you're 'binding' the function too early. I would probably test for
> typeof(uploader) == 'object' and wait until after jQuery(document).ready()
> has finished running.
>
> uploader.bind('UploadComplete', function() {
>  alert('123');
> });
>
> in the console works as expected.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list