diff --git a/collects/scribble/html-render.ss b/collects/scribble/html-render.ss
index fcbe1009..1e36b257 100644
--- a/collects/scribble/html-render.ss
+++ b/collects/scribble/html-render.ss
@@ -611,8 +611,8 @@
(list style-file)
style-extra-files))
,(scribble-js-contents script-file (lookup-path script-file alt-paths)))
- (body ((id ,(or (extract-part-body-id d ri)
- "scribble-plt-scheme-org")))
+ (body ([id ,(or (extract-part-body-id d ri)
+ "scribble-plt-scheme-org")])
,@(render-toc-view d ri)
(div ([class "maincolumn"])
(div ([class "main"])
diff --git a/collects/scribble/scribble-common.js b/collects/scribble/scribble-common.js
index e5304172..4ff914dc 100644
--- a/collects/scribble/scribble-common.js
+++ b/collects/scribble/scribble-common.js
@@ -80,6 +80,10 @@ function NormalizePath(path) {
return path;
}
+// `noscript' is problematic in some browsers (always renders as a
+// block), use this hack instead (does not always work!)
+// document.write("");
+
// Interactions ---------------------------------------------------------------
function DoSearchKey(event, field, ver, top_path) {
@@ -100,6 +104,13 @@ function TocviewToggle(glyph,id) {
glyph.innerHTML = expand ? "▼" : "►";
}
-// `noscript' is problematic in some browsers (always renders as a
-// block), use this hack instead (does not always work!)
-// document.write("");
+// Page Init ------------------------------------------------------------------
+
+// Note: could make a function that inspects and uses window.onload to chain to
+// a previous one, but this file needs to be required first anyway, since it
+// contains utilities for all other files.
+var on_load_funcs = [];
+function AddOnLoad(fun) { on_load_funcs.push(fun); }
+window.onload = function() {
+ for (var i=0; i