getPageHistory
Implements the API GetPageHistory, returning an object. On success, this object will contain a property revisions, which is an array of strings, each representing the ID of a revision.
jpal.getPageHistory(handler);
handler is the function that will handle the returned object (array).
The following function gets the ID of the oldest revision of the FrontPage, then gets that page and puts its source into a textarea:
function handlePage(page) { //handler to receive pages
var data = page.data;
document.getElementById('mytextarea').value = data;
}
function handleHistory(obj) { //handler to receive revision lists
var firstrev = obj.revisions[0];
jpal.getPage('FrontPage',handlePage,"raw",firstrev);
}
jpal.getPageHistory(handleHistory);
Comments (0)
You don't have permission to comment on this page.