[eluser]Berserk[/eluser]
Hi there, i've got a @#*&@# problem with JSON in IE8 (not tested in other IE version) but it worked fine in Firefox, Chrome and Safari:
this is my function:
Code:
function get_notifications_count() {
$count = $this->notifications->get_notification_count($this->user->id);
if($count->user_notification_count != 0) {
echo json_encode(array('status'=>1,'count'=>$count->user_notification_count));
}else {
echo json_encode(array('status'=>0,'count'=>'0'));
}
}
}
result :
Code:
{"status":0,"count":"0"}
and Jquery function:
Code:
$.getJSON(BASE_URL+'ajax/get_notifications_count', function(data){
if(data.status == 1){
$('#notificationcount').html(data.count).css('display','block');
}else{
$('#notificationcount').html(data.count).css('display','none');
}
});
it worked fine with FF, Chrome, Safari, but in IE8 got a stupd error :
Code:
Webpage error details
Message: 'status' is null or not an object
Line: 804
Char: 9
Code: 0
URI: http://localhost/public/js/base.js
i don't understand why and how to fix this problem. Help me plz.