![]() |
AJAX and jQuery problems at passing information to a CI Controller - 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: AJAX and jQuery problems at passing information to a CI Controller (/showthread.php?tid=5968) |
AJAX and jQuery problems at passing information to a CI Controller - El Forum - 02-10-2008 [eluser]Isern Palaus[/eluser] Hello, I recently started coding AJAX (today) and I've decided to use jQuery. I don't use the library for CI because it had some troubles trying to configure it and it's easiest to talk of the jQuery JS files. I'm trying to do a simple login (when it will be useful I'll write a few lines about to people who start coding AJAX) that checks the username/password. The problem is that it checks and EVERY TIME if it's correct or not returns me a "yes" on success. Here is the code: The View One: Code: <?php user.js Code: $(document).ready( The if(data.success... doesn't works too, anybody knows why? The part of the controller that contains the function checkLogin: Code: function _check_login($username) { The part of the model that checks the user login: Code: function checkUserLogin($username,$password,$table=users) Well, thanks in advance to everyone. Regards, -- Isern Palaus AJAX and jQuery problems at passing information to a CI Controller - El Forum - 02-13-2008 [eluser]Isern Palaus[/eluser] Hello, One of the mistakes on de jQuery was that writting JSON in uppercase it doesn't gets as OBJECT: Code: dataType: "JSON", Change it for: Code: dataType: "json", And now YES :-). When I have the all AJAX code/controller/model I'll publish as a Tutorial. Regards, -- Isern Palaus |