changeset 1650:1bfd793e7eb8

Add dynamic content before running its scripts, to get IDs in scope; fix generation of Postgres queries with blobs
author Adam Chlipala <adam@chlipala.net>
date Thu, 29 Dec 2011 16:08:34 -0500
parents 9253765d7724
children dfc854e478bb
files lib/js/urweb.js src/postgres.sml
diffstat 2 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lib/js/urweb.js	Thu Dec 29 14:12:03 2011 -0500
+++ b/lib/js/urweb.js	Thu Dec 29 16:08:34 2011 -0500
@@ -812,9 +812,9 @@
         } else {
             firstChild = document.createElement("span");
             firstChild.innerHTML = html;
-            runScripts(firstChild);
             if (x.parentNode)
                 x.parentNode.insertBefore(firstChild, x);
+            runScripts(firstChild);
         }
     };
 
--- a/src/postgres.sml	Thu Dec 29 14:12:03 2011 -0500
+++ b/src/postgres.sml	Thu Dec 29 16:08:34 2011 -0500
@@ -680,7 +680,7 @@
          string " };",
          newline,
          if List.exists isBlob inputs then
-             box [string "const int *paramLengths = uw_malloc(ctx, ",
+             box [string "int *paramLengths = uw_malloc(ctx, ",
                   string (Int.toString (length inputs)),
                   string " * sizeof(int));",
                   newline,
@@ -696,7 +696,6 @@
                                                  | _ => string "0",
                                                string ";",
                                                newline]) inputs,
-                  string " };",
                   newline]
          else
              box [string "const int *paramLengths = paramFormats;",