I’m trying to learn how make an AJAX script
for a LIKE button, on my website. I have the following questions:
if i’m sending 1 variable…. id.. I do this
data: "action=vote_up&id="+(this).attr("id")",
is this syntactically correct if i’m sending two variables id and id1 ?
data: "action=vote_up&id="+(this).attr("id")&id1="+(this).attr("id1")",
2) What goes into the href attribute? The php page or the AJAX?
<a href =""><img scr="like.png"></a>
3) which is run first.. The php page or the AJAX.
4) Is it mandatory for me to use jQuery or Pure Javascript for running AJAX
thanks for your time and patience. I most appreciate it.
<a href ="#"><img scr="like.png"></a>put onclick event on that link, and make AJAX request` to increment count, on success response update count clicks on button. And you forgot about one thing, you should save the state of that button. Because one user can go to your site and click 1000 times on it.