PennController for IBEX › Forums › Support › newhtml doesn’t work › Reply To: newhtml doesn’t work
April 17, 2023 at 3:55 am
#10454
Jeremy
Keymaster
Hi,
You can still use items = [ ["completion", "Form", {continueMessage: null, html: { include: "completion.html" }}] ]
if you’d like
When inserted inside a PennController trial via newHtml, the DOM elements are not added immediately, so document.getElementById("demo")
will be undefined
by the time the script gets executed. You could delay execution until the reference is defined: (function ud(){try{document.getElementById("demo").innerHTML = functionName();}catch(e){window.requestAnimationFrame(ud)}})();
Jeremy