Hi All,
I am implementing a facebook like "Like" button counter so everytime a user clicks on the button, via an ajax call a DIV tag besides it updates it from the db (see logic of the code below). However it isn't working. Please see all codes below:-
I have copied the code from the w3schools php ajax tutorial page and made some modifications for the button click call.
javascript:
MySQL:
HTML:
<img src="./images/like.jpg" style="cursor:hand;" onclick="likeAJAX(<?php echo $_GET['val']; ?>)"><?php echo $likeVal; ?> people like this</span>
Seems like the onclick isn't working, i have tried putting an alert on the javascript function but it isn't getting triggered. Is it some typo/syntax error with the javascript function onclick not being able to recognize the php variable being called.
Regards,
Ochen