CodeIgniter Forums
problem with ajax - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: problem with ajax (/showthread.php?tid=45485)



problem with ajax - El Forum - 09-23-2011

[eluser]Unknown[/eluser]
within my view ive got my inbox system and to delete a message ive got an image with class="delete"
calling the following code

Code:
$(document).ready(function(){
$('.delete').click(function(){
$.ajax({
type: "POST",
url: "/index.php/messages/delete",
    data: "id="+$(this).prev().text(),
         success: function(html){
    $('#msg_container').fadeOut('slow').load('/index.php/inbox').fadeIn("slow");}, 20000);
    }
      });
      return false
      });
      });
my controller is

Code:
function delete() {
  $name['delete_me']=$_POST['id'];
  $result = $this->user->deletepm($name);
  $this->output->set_output('works');

}

but nothing is working help?