Greeting Page | Table Page | New Node Page | Form Page |
This page shows how to add a span of HTML from an external resource into a page at runtime. The file addme.txt contains the HTML to be inserted. If you can modify the HTML in the addme.txt, be sure that resulting span has valid tags. Missing end tags can cause the page to fail. The html for the span is:<span id="spanInsertHere">placeholder</span>Below is the span with the inserted HTML: placeholder that will be replaced HTMLElement element = page.getElementSpanInsertHere(); String fromFile = readFile(); Node newNode = page.createCDATASection(fromFile); element.getParentNode().replaceChild(newNode, element); |
Lutris | Enhydra |