diff lib/js/urweb.js @ 646:fb2a0e76dcef

ListEdit demo, minus prose
author Adam Chlipala <adamc@hcoop.net>
date Tue, 10 Mar 2009 12:44:40 -0400
parents c5991cdb0c4b
children 96ebc6bdb5a0
line wrap: on
line diff
--- a/lib/js/urweb.js	Tue Mar 10 11:18:01 2009 -0400
+++ b/lib/js/urweb.js	Tue Mar 10 12:44:40 2009 -0400
@@ -59,10 +59,12 @@
 function runScripts(node) {
   var savedScript = thisScript;
 
-  var scripts = node.getElementsByTagName("script");
+  var scripts = node.getElementsByTagName("script"), scriptsCopy = {};
   var len = scripts.length;
+  for (var i = 0; i < len; ++i)
+    scriptsCopy[i] = scripts[i];
   for (var i = 0; i < len; ++i) {
-    thisScript = scripts[i];
+    thisScript = scriptsCopy[i];
     eval(thisScript.textContent);
   }