i am stuck at some json parsing, i am populating some fields using jquery's ajax function, i found the desired result, but dont know how to print it, here is my code
function logged_in_users() {
$.ajax({
url: site_url+'user/get_loggedin_users',
dataType : 'json',
success: function(result) {
$('#div_id').append(result.email_address)
}
});
}
while i have a result in my console response like,
[{"email_address":"[email protected]"},{"email_address":"[email protected]"}]
while on the function side i am using,
echo json_encode($this->login_history_model->get_logged_in_users());
Any help will greatly be appreciated