I apologize in advance if this is the wrong place to post this sort of thing, but here we go:
Here is the code I'm currently implementing on my webiste (Thanks to charlietfl for this code)
$(document).ready(function(){
var url='http://query.yahooapis.com/v1/public/yql?q=select * from html where url=\'https://stackoverflow.com/\'and xpath=\'//div[@id="question-mini-list"]//h3//a\'&format=json&callback=?';
$.getJSON( url, function(data){
$.each(data.query.results.a, function(){
$('#stack').append('<td><a href="http://stackoverflow.com'+this.href +'">'+this.content+'</a></td>')
})
})
});
I hate to use code I don't fully understand, So here is my questions:
In the 'var url' in the query, he uses @id="question-mini-list". I looked in the html of stackoverflow, and there is nothing by that name (closest I got was a class named 'question-hyperlink'), so why does that work?
Second: In the 'each', data.query.results.a I don't see 'query' or 'results' used anywhere else, so how I know to use those?.
Last question: at the end of your 'url' why 'callback=?' ?
Thank you so much! :)