You should do something like
$('.classofyourlink').click(function(e){
e.preventDefault();
$.post(...);
});
in this way, the user makes an ajax call by clicking the link without redirecting. Here are the docs for $. Post
EDIT - pass the jQuery value in your case, you should do something like
$('.order_this').click(function(e){
e.preventDefault();
var valueToPass = $(this).text();
var url = "url/to/post/";
$.post(url, { data: valueToPass }, function(data){...} );
});
source
share