getPage
Implements the API GetPage function, which returns a wiki page and associated meta data. getPage returns the data as a parameter passed to a specified handler:
jpal.getPage(page,handler,format,rev);
page is the page name as a string
handler is the function to which getPage will pass the page object
format is a string set to "rendered", "raw", or "none". If set to "none", only meta data will be returned. Defaults to "rendered".
rev specifies the revision to return. Defaults to the newest revision. See getPageHistory for how to get the revision list.
The returned object is exactly the one in the API GetPage function, but without the "v1" wrapper level. For example, the following code copies the WikiStyle contents of a page to a textarea element:
function outputPage(obj) {
var data = obj.data;
document.getElementById('mytextarea').value = data;
}
jpal.getPage('FrontPage',outputPage,"raw");
Comments (0)
You don't have permission to comment on this page.