0

Hi everyone,

I'm using jquery in this piece of script and also trying to call the functions. But, they aren't working at ALL and the firefug is saying that there is an error in the script. The error is

missing ) in parenthetical
[Break On This Error]

$.post('ajax/like_add.php', (article_id:article_id), function(data){

and the firebug points to the colon.


This is the entire piece of script that has both functions.

function like_add(article_id){
	$.post('ajax/like_add.php', (article_id:article_id), function(data){
		if(data == 'success'){
			like_get(article_id);
		}else{
			alert(data);
		}
	});
}


function like_get(article_id){
	$.post('ajax/like_get.php',(article_id:article_id), function(data){
		$('#article_'+article_id+'_likes').text(data);
	});
}

Thanks, folks.

4
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by lambing
0

like_add.php is inside the folder ajax in your server. it will handle your ajax request, it is the backend of your ajax call.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.