How to use Ajax to achieve the likes
Php+mysql implementation of the method is very simple, every click Like, incoming field (Cont_id,cont_type), each time to the database like_count automatically plus 1, but how to use the AJAX implementation of jquery? Ajax jquery PHP
Share to:
------Solution--------------------
$.ajax ({
Type: "Get",
URL: "xxxxxxxxxxxxxx.php",
data:{
Action: "Dianzan", //php identification of AJAX flags (this one does not necessarily add, see PHP file structure
UID: "xxxxxxxxxxx", //Who initiated the praise,
PID: "Xxxxxxxxx", //what element is liked
},
Success:function (msg) {
Receive the information returned by PHP, whether to praise the success, if successful, the foreground JS to make special effects conversion to remind users to praise success If unsuccessful then prompt reason and so on
}
});
------Solution--------------------
Suggest a direct watch video tutorial
Http://www.php100.com/html/shipinjiaocheng/PHP100shipinjiaocheng/2011/0417/7924.html
Look at the bag will