[eluser]jacobson[/eluser]
Hello I have a problem with my application. I have on my page
Code:
<div id="newsList">
</div>
and I have mechanism which takes the selected checkboxes and filters the news displayed on the screen.
I have my $.ajax function
Code:
$.ajax({
type : 'POST',
url : 'http://localhost/ajaxCall',
data: {
action : 'getNews',
categories : categories
},
success : function(data){
$('#newsList').fadeOut(200, function(){
$('#newsList').html(data);
$('#newsList').fadeIn();
});
}
});
this code should go to my site_controller/ajaxCall (i have routing) and site_controller is a default controller.
Inside the ajaxCall method i have
Code:
function ajaxCall() {
switch ($_POST['action']) {
case 'getNews' : getNewsByCategories($_POST['categories']);
break;
}
}
and in the getNewsByCategories function i simply have
in order to show 1 inside the newsList div on my page. But It's not working. Mabe I made a mistake earlier but I cant find it, mabe a fresh eye will find an issue. I would appreciate your help
//edit
omg... im gonna explode
inside ajaxCall should be $this->getNewsByCategories($_POST['categories']); ....
anyway thx