diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/js/urweb.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index ba73e744..adab5f43 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -643,9 +643,10 @@ function parent() { } function addNode(node) { - if (thisScript) - thisScript.parentNode.replaceChild(node, thisScript); - else + if (thisScript) { + if (thisScript.parentNode) + thisScript.parentNode.replaceChild(node, thisScript); + } else lastParent().appendChild(node); } |