Skip to content

Instantly share code, notes, and snippets.

@anointed
Created July 21, 2012 05:20
Show Gist options
  • Save anointed/3154688 to your computer and use it in GitHub Desktop.
Save anointed/3154688 to your computer and use it in GitHub Desktop.
media uploader
$(document).ready(function() {
$('#button-upload').click(function() {
formfield = $('#image-upload').attr('name');
tb_show('', 'media-upload.php&tab=shawn_upload&type=image&TB_iframe=true');
return false;
});
window.send_to_editor = function(html) {
imgurl = $('img',html).attr('src');
$('#image-upload').val(imgurl);
tb_remove();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment