Hello Guys, am developing a balloon notifications for my social network. i came across this error when there's 2 or more notifications. i checked my json response on jsonlint.com i got error at line 6
JSON response:
{
"nid": "1101",
"img": "<img src=\".\/images\/icons\/he_wall_post_icon.png\">",
"notifier": "Sarah O'conner",
"url": " has commened on your <a href=\"wall_action.php?id=1463\">post<\/a>"
}{
"nid": "1100",
"img": "<img src=\".\/images\/icons\/he_wall_post_icon.png\">",
"notifier": "Sarah O'conner",
"url": " likes your <a href=\"wall_action.php?id=1463\">post<\/a>"
}
here's my php part:
$ret_arr = array('nid' => $nid2,'img' => $img, 'notifier' => $notifier, 'url' => $url);
echo json_encode($ret_arr);
here's my js part:
function noob()
{
jQuery.ajax({
url: 'notifications.php?n=1',
dataType: 'json',
success: function(data){
alert('Success!');
},
error: function(requeset, textStatus, errorThrown){
alert('error:'+textStatus);
}
});
}
how can i get that done!
thanks guys.