We help IT Professionals succeed at work.
Get Started

Change word from Like to Unlike and change link!

Member_2_5230414
on
813 Views
Last Modified: 2012-05-09
Below is what i have so far.

What i would like to do is change the like to unlike when the user clicks the like button so then they can change their mind if need be.
$(function() 
{
$(".likes").click(function() 
{
var ID = $(this).attr("id").replace('vi', '');

$.ajax({
type: "POST",
url: "include/likeit.php",
data: "msg_id="+ ID, 
cache: false,
success: function(html){
$("#likes"+ID).prepend(html);
$("#view"+ID).remove();
$("#two_comments"+ID).remove();
}
});
return false;
});
});




<a href="#" class="likes" id="<?php echo $id; ?>">Like?</a> jarratt and <a href="#" class="123" id="<?php echo $id; ?>">3 others</a> like this.
<div id="123<?php echo $id; ?>"></div>
<div id="likes<?php echo $id; ?>"></div>

Open in new window

Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 16 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE