![]() |
I can't get the responce for ajax post call. - 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: I can't get the responce for ajax post call. (/showthread.php?tid=27460) |
I can't get the responce for ajax post call. - El Forum - 02-11-2010 [eluser]chefnelone[/eluser] Hello. I can't get the responce for ajax post call.(using jquery). But this problem just happens in the remote server. In my locallhost works fine. :ohh: I have the form: Code: <form id='test'> the js: Code: $(document).ready(function() { and the method in shop controller: Code: function test() I cant's spot the mistake. .. I can't get the responce for ajax post call. - El Forum - 02-11-2010 [eluser]danmontgomery[/eluser] Use firebug to capture any xmlhttprequests I can't get the responce for ajax post call. - El Forum - 02-11-2010 [eluser]chefnelone[/eluser] thanks You mean the Console? As far as I understand the path to the method is correct. (but it is in red, I don't know why) I even get the message from the method (using $this->firephp->log( $data ); ) How can it work fine in my locallhost but not in the remote server? I'm blank. What can I do? This is what I get in the Console(images for 'Sent' and 'Headers') I can't get the responce for ajax post call. - El Forum - 02-11-2010 [eluser]Eric Barnes[/eluser] Now I don't know much about jquery but should it not be "success: function()" instead of just function? I can't get the responce for ajax post call. - El Forum - 02-11-2010 [eluser]SpooF[/eluser] Have you tried calling the URI and making sure its not erroring? I can't get the responce for ajax post call. - El Forum - 02-11-2010 [eluser]chefnelone[/eluser] [quote author="SpooF" date="1265942194"]Have you tried calling the URI and making sure its not erroring?[/quote] Hello spoof. can you tell me how to do it please. I can't get the responce for ajax post call. - El Forum - 02-11-2010 [eluser]Jake Grice[/eluser] I had this problem the other day on a simple email form that used Ajax with almost the exact same setup. (Serializing a form with $.post). It just wouldn't alert the return value. After debugging it, and getting it to work, it turned out to be an error in the native mail function so I used SMTP. Try making your test function echo out text without doing anything else. What is the URL of the project? I can't get the responce for ajax post call. - El Forum - 02-12-2010 [eluser]chefnelone[/eluser] I started again from a clean codeigniter application and I got it working but with this problem: In the js function I must to use this line: $.post('index.php/test/processFormAjax' , $(this).serialize() , function(html){... But... it doesn't work if I change that line to this: $.post( base_url + 'test/processFormAjax' , $(this).serialize() , function(html){... or $.post('/test/processFormAjax' , $(this).serialize() , function(html){... or $.post('/processFormAjax' , $(this).serialize() , function(html){... I create this very simple example: The example uses this code: 'test.php' Controller: Code: class Test extends Controller { test.php View Code: <html> I can't get the responce for ajax post call. - El Forum - 11-27-2010 [eluser]Unknown[/eluser] change the name of the function from 'test' to anything.. I don't know why but codeigniter ignores functions with the name 'test'... |