A problem with a simple code jquery/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: A problem with a simple code jquery/ajax. (/showthread.php?tid=49932) |
A problem with a simple code jquery/ajax. - El Forum - 03-07-2012 [eluser]jesusruiz[/eluser] Hello everyone and thanks for reading this message. I have a problem that can not find reason to not work. I am creating a validation for a user registration form with CodeIgniter, and I have a javascript file with this code: Code: $(document).ready(function(){ The only thing that makes this code is showing a warning screen with a message, when the user completes the 'field_username' (username in DB), which of course is a field that I have defined. The method code of username_check_ajax is as follows: Code: function username_check_ajax() As you can see nothing special, but the problem is that to check the result, the screen shows the alert, but does not appear the text of the function username_check_ajax. I tried a thousand things, but can not get any satisfactory results. Of course, other codes in the method username_check_ajax, such as the following, also shows me the text message alert: Code: function username_check_ajax() Does anyone have any idea where is the bug in my code?. THANKS. A problem with a simple code jquery/ajax. - El Forum - 03-07-2012 [eluser]CroNiX[/eluser] Don't use relative paths. If you looked with firebug, I bet you would see that the request isn't being sent properly. A problem with a simple code jquery/ajax. - El Forum - 03-08-2012 [eluser]jesusruiz[/eluser] CroNiX, thousands of thanks. Missing a slash at the beginning of the route :down: I've taken a whole day trying codes, and finally the problem was less thinking. Thank you very much for your help, I owe you one ;-) |