i have never used ajax before so i want to make sure iam doing this right.
this php code work fine. i didnt add it bc it was long code. but all it does it add one or sub one from database.
<?php
//if user hit like link add one from database
//if user hit dislike link sub one from database
?>
i am building a raiting system. i have two buttons here
<a href='index.php' id='like'>thumb up</a>
<a href='index.php' id='dislike'>thumb down</a>
than i am displaying how many liks or dislike user have. info i am getting from database. so when user hit like button i am add one t database and here i am getting the infomation. this also work fine.
...
$like_db -- $dislike_db
the problem is the page reload every time user hit like or dislike links. i want it to do same thing but no reload.
so here what iam think so far:
$(document).ready(function(){
$("#like").click(function(){
//get information from database.
//display information here? -- $like_db
}});
$("#dislike").click(function(){
//get information from database.
//display information here? -- $dislike_db
}});
});
});