Ajax issue |
[eluser]detooth[/eluser]
Hey everyone, Im new to CI but have much experience with PHP and many other langs. I have developed AJAX methods for a while now but am running into a strange issue with CI. I am using jQuery to make the post to a delete method in an account controller. I can make hte post without a problem, the delete happens and I get a return. The problem is that I want to only return the success or failure STRING. However, I am being returned the entire HTML of my application layout. Is there any way to make the output a simple string? This is my delete method: Code: function delete($id)
[eluser]detooth[/eluser]
Actually, I think I may know what the problem is. I will post later when if I have it.
[eluser]detooth[/eluser]
OK. I followed this thread to create a RoR type layout system: http://ellislab.com/forums/viewthread/57902/ Using the code posted (which works great by the way), I kept returning the view in my layouts folder as the result. So, I added a check in the Yield.php file to determine if the request is an AJAX request. If so, I return the output at this point. Works great. If anybody else runs into this, I would be happy to post my solution. |
Welcome Guest, Not a member yet? Register Sign In |