xxxxxxxxxx
Create a variable in javascript:
<script type="text/javascript">
var templateDirectory = '<?php bloginfo('template_directory'); ?>';
</script>
From there you can do whatever you want, like so:
$('#my-image').attr('src', templateDirectory + '/images/image.png');