J.P.A.L.

 

renderContent

Page history last edited by Anonymous 2 yrs ago

renderContent

 

Encapsulates the API RenderContent function, which takes text in WikiStyle format and converts it into HTML, without all the extra stuff like headers and footers.

 

jpal.renderContent(data,handler);

 

data is the text to be rendered (in WikiStyle format).

handler is the function that receives the rendered data.

 

In the following example, in input string containing "!Hello World" would get converted to <h1>Hello World</h1>.

 

document.write('<div id="test"></div>'); //a container for the data
function handleData(data) {
if (!data || data.error) {
alert('Error receiving data');
return;
}
var temp = document.getElementById('test');
temp.innerHTML = data.html;
}
var inputString = '!Hello World';
jpal.renderContent(inputString,handleData);

Comments (0)

You don't have permission to comment on this page.