Before, I used php and it was fine, with:
foreach($api['available_channels'] as $channel){
$number = $channel["num"];}
Right now I want to do the loop with ajax, for channels num 1 until the end.
How can I do that?
JSON Output:
http://jsfiddle.net/gnpj5csk/27/
var yql_url = 'https://query.yahooapis.com/v1/public/yql';
var url = 'http://****/**.php?username=***&password=***';
$.ajax({
'url': yql_url,
'data': {
'q': 'SELECT * FROM json WHERE url="'+url+'"',
'format': 'json',
'jsonCompat': 'new',
},
'dataType': 'json',
'success': function(response){
alert(response.query.results.json.available_channels);
},
});