I am using the .ajax function for an ajax call in codeigniter , my controller is called control and i have a function in it called Login
but when i'm running this code :
$.ajax({
url: "Connection/Login",
type: "POST",
data: Login_data,
success: function () {
alert('ajax worked');
}
});
the console gives me the 404 not found error. And adding index.php does not work.
EDIT : i'm able to acces my function in my controller without mentioning the controller at all, so i can call url : "login" , i don't need to add the controller called connection ?
is this because of my route file? because i need that route file for an organized url and i cannot acces another controller function but the controller setup as default controller
route file :
$default_controller = "Webpages"; $controller_exceptions = array('admin','forums');
$route['default_controller'] = $default_controller; $route["^((?!\b".implode('\b|\b', $controller_exceptions)."\b).*)$"] = $default_controller.'/$1'; $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE;
control/login
in the url – claudios