<script>
/*
{
"batchcomplete": "",
"query": {
"pages": {
"125293": {
"pageid": 125293,
"ns": 0,
"title": "Copper",
"revisions": [
{
"contentformat": "text\/x-wiki",
"contentmodel": "wikitext",
"*": "Some Data"
}
]
}
}
}
}
*/
var link ="https://en.wikipedia.org/w/api.php?action=query&titles=Copper&prop=revisions&rvprop=content&format=json";
$.ajax({
url: link,
dataType: 'JSON',
type: 'get',
cache: false,
success: function(data) {
$(data).each(function(index, value) {
//print value.child
document.getElementById('data').innerHTML = value.query.pages.125293.title;
});
}
});
</script>
Please provide me with and example on how to modify my code to get to the title child. Other alternatives are appreciated but please keep it simple. It seems that a lot of users just tend to copy and paste material from other site with not even a hint of how JQUERY works. So please don't paste some one else work. Thanks in advance.