Created
July 21, 2012 05:20
-
-
Save anointed/3154688 to your computer and use it in GitHub Desktop.
media uploader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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