I'm using the Stack Apps API. Retrieving questions by tags works well, and the JSON is returned. Now I need to parse the JSON and there is something wrong with my code:
$.ajax({
url: 'http://api.stackexchange.com/2.1/search?page=1&pagesize=15&tagged='+_tags+'&site=stackoverflow',
dataType:'json',
type:'GET',
error:function(e){
console.log(e);
},
beforeSend:function(){
},
success: function(data){
for(var I = 0 ; I < data.length; I ++){
alert(data.items[I].question_id);
}
}
});
the JSON is not alerted, nothing is alerted.
the JSON I retrieve is like this:
{
"items":[
{
"question_id":13744926,
"creation_date":1354801586,
"last_activity_date":1354802622,
"score":-3,
"answer_count":3,
"title":"How to avoid concurrent exception in ArrayList in android?",
"tags":[ "java", "android"],
"view_count":33,
"owner":{
...
},
"link":"http://stackoverflow.com/questions/13744926/how-to-avoid-concurrent-exception-in-arraylist-in-android",
"is_answered":true
},
...
...
],
"quota_remaining":271,
"quota_max":300,
"has_more":true
}
What am I doing wrong?