It's not as easy as you might think. The API returns pages with internal ID's, and you have to use the API again to get information on the particular page, such as the URL.
$.getJSON("http://en.wikipedia.org/w/api.php?action=query&generator=random&grnnamespace=0&prop=extracts&explaintext&exintro=&format=json&callback=?", function (data) {
$.each(data.query.pages, function(k, v) {
$.getJSON('http://en.wikipedia.org/w/api.php?action=query&prop=info&pageids='+v.pageid+'&inprop=url&format=json&callback=?', function(url) {
$.each(url.query.pages, function(key, page) {
console.log(page); // contains the page data
var url = page.fullurl; // the url to the page
});
});
});
});