[jQuery] Newbie -- How to retrieve img src value in function?
I am using jquery 1.1.2, interface 1.2, working with drag/drop.
When user drops an image onto the drop area, I want to retrieve the
src value, so that eventually I can send that value to the server
and do some Ajax stuff. But so far, in my code below,
I have only gotten this to work:
var thePhoto = drag.innerHTML;
That returns <img src="static/galleries/JQm49CWi09/_t/
lilly01_fuy.jpg">
How can I just get the src string?
// The code
<script type="text/javascript">
$(document).ready(
function() {
$('#drag').Draggable( );
$('#dropbox').Droppable(
{
accept : 'dropaccept',
activeclass: 'dropactive',
hoverclass: 'drophover',
ondrop: function (drag) {
var thePhoto = drag."what should go here?";
//var thePhoto = drag.innerHTML; // almost there
alert( thePhoto );
},
tolerance: 'fit'
}
);
}
);
</script>