Monday 2 June 2014

How to pass multiple variables in AJAX

Posted by Саша 01:09, under | No comments


How to pass multiple variables in AJAX? How to pass multiple variables in AJAX?

$(function() {

$(".follow").click(function()
{

var user_id = $(this).attr("id");
var datastring = 'user_id='+ user_id ;

var uid = $("#profile_id").val();

$.ajax({
type: "POST",
url: "back/add_follow_user.php",
data: datastring,
success: function(html){}
});

$("#follow"+user_id).hide();
$("#remove"+user_id).show();
return false;

});

});


Here I am passing just one variable "user_id" through AJAX.
I also want to pass variable "uid".
What will be the syntax for it?














0 коммент.:

Post a Comment