**
function Foo(){
event.preventDefault();
$.ajax( {
url:"<?php echo base_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..!!
NBNB :Don't Don't forget to put event.preventDefault(); event.preventDefault(); at the beginning of the body of the function .