I have a classifieds website, and on the page where ads are showed, I am creating a \"Send a tip to a friend\" form...
So anybody who wants can send a tip of the ad
function Foo(){
event.preventDefault();
$.ajax( {
url:"Controllername/ctlr_function",
type:"POST",
data:'email='+$("#email").val(),
success:function(msg) {
alert('You are subscribed');
}
} );
}
I tried many times for a good solution and answer by @taufique helped me to arrive at this answer.
NB : Don't forget to put event.preventDefault();
at the beginning of the body of the function .