• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to delete my entry in ajax way

[eluser]Wondering Coder[/eluser]
Hello to all CI fans,

I'm having a bit of trouble in implementing it using ajax call. What I want is to delete an entry/data in ajax. I know that I can achieve this using jQuery library, but I'm pretty novice in writing codes in javascript.

my controller function
function delete()
        $item = $this->input->post('item');
        if($message_data != NULL) {
        } else{

my view
<div align='right' style='float: right;'><a href='' id='del_comment' class='del_comment'></a></div>

Read into the jQuery post() function, which is a shorthand method of using the jQuery ajax function but defaulting to POST values instead of GET. http://www.jqapi.com/#p=jQuery.post

You could also try XAJAX, I used it to call controller methods all the time. See: http://ellislab.com/forums/viewthread/182897/

Pretty straight forward to ajax deletes...

Hope it helps.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.