Nachdem du jQuery verwendet wäre doch die unobstrusive Variante elganter und einfacher:
<img class="like_btn" src="img/like_50.png" alt="" rel="<user_id>_<post_id>">
<script>
$(document).ready( function() {
$('.like_btn').click( function() {
var user_post = $(this).attr('rel'); //<-- this verweist hier tatsächlich auf das img
...
$.get(...);
} );
} );
</script>
--
for your security, this text has been encrypted by ROT13 twice.
for your security, this text has been encrypted by ROT13 twice.