Mercurial > urweb
changeset 599:889dc9fceb3a
Use header to set default script type
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 11 Jan 2009 10:22:19 -0500 |
parents | 4c2c740c6931 |
children | d1cce194180d |
files | src/c/urweb.c src/cjr_print.sml src/monoize.sml |
diffstat | 3 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/c/urweb.c Sun Jan 11 10:05:06 2009 -0500 +++ b/src/c/urweb.c Sun Jan 11 10:22:19 2009 -0500 @@ -382,7 +382,7 @@ } else { char *r = uw_malloc(ctx, 41 + (ctx->script_front - ctx->script)); - sprintf(r, "<script type=\"text/javascript\">%s</script>", ctx->script); + sprintf(r, "<script>%s</script>", ctx->script); return r; } }
--- a/src/cjr_print.sml Sun Jan 11 10:05:06 2009 -0500 +++ b/src/cjr_print.sml Sun Jan 11 10:22:19 2009 -0500 @@ -2054,6 +2054,8 @@ newline, string "uw_write_header(ctx, \"Content-type: text/html\\r\\n\");", newline, + string "uw_write_header(ctx, \"Content-script-type: text/javascript\\r\\n\");", + newline, string "uw_write(ctx, \"<html>\");", newline, box [string "{",
--- a/src/monoize.sml Sun Jan 11 10:05:06 2009 -0500 +++ b/src/monoize.sml Sun Jan 11 10:22:19 2009 -0500 @@ -1898,7 +1898,7 @@ e), _), _)] => (e, fm) | [("Signal", e, _)] => ((L'.EStrcat - ((L'.EPrim (Prim.String "<script type=\"text/javascript\">dyn("), loc), + ((L'.EPrim (Prim.String "<script>dyn("), loc), (L'.EStrcat ((L'.EJavaScript (L'.Script, e, NONE), loc), (L'.EPrim (Prim.String ")</script>"), loc)), loc)), loc), fm) @@ -1919,7 +1919,7 @@ loc)), loc), fm) end | SOME (_, src, _) => - (strcat [str "<script type=\"text/javascript\">inp(\"input\",", + (strcat [str "<script>inp(\"input\",", (L'.EJavaScript (L'.Script, src, NONE), loc), str ")</script>"], fm))