diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-12-29 16:08:34 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-12-29 16:08:34 -0500 |
commit | 634eee2d60c71d5a50e6bc6c3364d49548f58599 (patch) | |
tree | a7c6ec7ebc81baeeb6594b39d1c370c9aa9c582d | |
parent | 09acf221dc8c0f1a19d737e98a952ff633c9330c (diff) |
Add dynamic content before running its scripts, to get IDs in scope; fix generation of Postgres queries with blobs
-rw-r--r-- | lib/js/urweb.js | 2 | ||||
-rw-r--r-- | src/postgres.sml | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index ba73e744..8b6e2a75 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -812,9 +812,9 @@ function dyn(pnode, s) { } else { firstChild = document.createElement("span"); firstChild.innerHTML = html; - runScripts(firstChild); if (x.parentNode) x.parentNode.insertBefore(firstChild, x); + runScripts(firstChild); } }; diff --git a/src/postgres.sml b/src/postgres.sml index f3b9e3f1..c180e38f 100644 --- a/src/postgres.sml +++ b/src/postgres.sml @@ -680,7 +680,7 @@ fun makeParams inputs = 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 @@ fun makeParams inputs = | _ => string "0", string ";", newline]) inputs, - string " };", newline] else box [string "const int *paramLengths = paramFormats;", |