0
I’m trying to create a script so when the person click Like she will like the post, and when you click Excuse, will forgive the post, obvious, I managed to do this successfully, but I had to do this by putting the jquery script in PHP, making each result, a new script was created, it would be too big. I wanted to leave only 1 code, as I do to get the IDS there in the case of dynamic results?
Let me explain briefly, why it got a little confused, I want to instead of having to put this javascript in the dynamic select, put only 1 code for all.
JQUERY
$(document).ready(function(){
// like and unlike click
$("#like<?php echo $row['idd']; ?>, #unlike<?php echo $row['idd']; ?>").click(function(){
var iconCarregando = $('<img src="loading.gif" width="70"> arregando. Por favor aguarde...');
$('#statuslike<?php echo $row['idd']; ?>').html(iconCarregando);
$.ajax({
type: "GET",
url: 'acoes.php?like=1&id=<?php echo $row['idd']; ?>',
success: function(data){
$(iconCarregando).remove();
} });
});
});
HTML
(the code is half, why can’t I put the full code)
a href="javascript:void(0);" id="like'.$msg_id.'" title="Like" rel="Like"><i class="fa fa-hand-peace-o margin-r-5"></i> Aplaudir
We need to be aware of what you’ve done and how you’re doing to help.
– Mauro Alexandre
But I already put the.O there.
– Vinicius Henzel
The way I did, and how I wanted it to be, I don’t know how to do...
– Vinicius Henzel