I suspect my problem is due to the structure of my JSON string. It seem to have a JSON object within a JSON object.
This is the format of my JSON:
[
{"subject":{"title":"java","id":"1","desc":"Basic java programming"},
{"subject":{"title":"objective c","id":"2","desc":"Introduction to objective c"}
}
This is my jquery code:
var items = [];
$.getJSON('theurl', function(data) {
$.each(data, function(key, subject) {
alert(subject); //returning me "[object Object]"
$('#tempresult').append('<p>'+ subject +'</p>'); //returning me "[object Object]"
});
});