load() – jQuery API or how to use load function of jquery?


$('#likediv').load('ajax/like-updates.php',{ 'category':cat ,'type_id': typeid,'user_id': userid});

Example :

function likeEvent(cat,typeid,userid)
{
$('#likediv').load('ajax/like-updates.php',{ 'category':cat ,'type_id': typeid,'user_id': userid});
}

Note:

 #like => div is a id of div where you will want to show your data.
load => is a function where we gave path of a file where calculation takes place.
{ 'category':cat ,'type_id': typeid,'user_id': userid} => in braces we pass the parameter like there are passing 3 parameter
Finally we can call a this function on any event

Comments