function someFunction ( user_id, post_id )
{
$.ajax({
url: "http://my-website/ajax/u-favorite.php",
type: "POST",
data: {
userID: user_id,
postID: post_id
},
success: success_add_favorite()
});
}
if ( isset( $_POST["add_favorite_btn"] ) )
{
add_favorite( $_POST["userID"], $_POST["postID"] );
}