diff lib/js/urweb.js @ 2002:9356e8f91ea4

Change <active> to avoid generating an empty <span> for empty content
author Adam Chlipala <adam@chlipala.net>
date Mon, 21 Apr 2014 12:09:58 -0400
parents abb6981a2c4c
children 93ff76058825
line wrap: on
line diff
--- a/lib/js/urweb.js	Thu Apr 17 17:41:24 2014 -0400
+++ b/lib/js/urweb.js	Mon Apr 21 12:09:58 2014 -0400
@@ -1009,8 +1009,6 @@
     if (suspendScripts)
         return;
 
-    var span = document.createElement("span");
-    addNode(span);
     var ms = maySuspend;
     maySuspend = false;
     try {
@@ -1020,7 +1018,11 @@
         throw e;
     }
     maySuspend = ms;
-    setInnerHTML(span, html);
+    if (html != "") {
+        var span = document.createElement("span");
+        addNode(span);
+        setInnerHTML(span, html);
+    }
 }
 
 function input(x, s, recreate, type, name) {