Jquery .post with json problem
Hi,
I am having a strange problem with my jquery code. I am making an ajax call to a php page and everything seems to work fine except the resulting JSON is coming as [Object][Object], [Object][Object] and so on. Here is my jquery code
- $.post('user/getPreviousInsertedTSData',{month:month},function(response){
- alert(response);
- },"json");
And here is my php code:
- $this->load->model('timesheets');
- $resSet['result'] = $this->timesheets->getUserReport($month,$user);
- $resStr = json_encode($resSet['result']);
- log_message('error',json_encode($resSet['result']));
- echo $resStr;
I am using Codeigniter And in the log the JSON is coming fine, but in the alert box it's coming as [Object][Object], [Object][Object] and so on. Any ideas?