Jquery post help - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Jquery post help (/showthread.php?tid=33294) Pages:
1
2
|
Jquery post help - El Forum - 08-21-2010 [eluser]Techno Heart[/eluser] Hi all, I am working in a codeigniter project now. I am trying to delete a reply in a form which has many replies for one question. it is in loop having edit and delete options for all replies. i want to delete a reply. so in jquery i written one confirmation box. if they click ok using $.post i will pass id to controller then i will call model. the file is deleting fine. but it is not returning any data to jquery $.post to show the alert success.instead of showing success alert it is showing failure alert. any one here faced this issue… Jquery post help - El Forum - 08-21-2010 [eluser]vitoco[/eluser] what's the exact "failure alert"? post some code Jquery post help - El Forum - 08-21-2010 [eluser]Techno Heart[/eluser] Code: $("#delete_topic").live('click',function() in the above code the condition 1 to be executed if it is deleted successfully. but its coming to else condition saying try again later. Jquery post help - El Forum - 08-21-2010 [eluser]vitoco[/eluser] Add to the callback , to see what it's getting returned from the server Code: console.log('[['+html+']]') and post it Jquery post help - El Forum - 08-21-2010 [eluser]Techno Heart[/eluser] Its returning null value..if the query executes correctly it will return 1 else 2. but its returning null. While posting the datas i can see in firbug the url that is passing right..in that its showing red color url.some error telling line 130 in jquery.min.js Jquery post help - El Forum - 08-21-2010 [eluser]vitoco[/eluser] try this code Code: $("#delete_topic").live('click',function() Jquery post help - El Forum - 08-22-2010 [eluser]Techno Heart[/eluser] the html code u defined in last line Code: },html); Jquery post help - El Forum - 08-22-2010 [eluser]vitoco[/eluser] sorry...my mistake Code: $("#delete_topic").live('click',function() Jquery post help - El Forum - 08-22-2010 [eluser]Techno Heart[/eluser] The alert i am getting is [[]] and as i mentioned early it is going to else block and giving alert try again later.It means its returning null i guess. Jquery post help - El Forum - 08-22-2010 [eluser]vitoco[/eluser] the return isn't null, just an empty string ( the return it's 'text' ), meaning that your are not doing any 'echo' in server side. |