Skip to main content

**

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 .

**

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..!!

NB:Don't forget to put event.preventDefault(); at the beginning of the body of the function .

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.

NB : Don't forget to put event.preventDefault(); at the beginning of the body of the function .

Source Link
Dayz
  • 269
  • 2
  • 13

**

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..!!

NB:Don't forget to put event.preventDefault(); at the beginning of the body of the function .