Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Denis McMahon Newsgroups: comp.lang.javascript Subject: Re: JavaScript in a PRE element of an HTML document Date: Sun, 9 Mar 2014 22:16:36 +0000 (UTC) Organization: A noiseless patient Spider Lines: 52 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 9 Mar 2014 22:16:36 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="66ffcfa4470a58bcddbdcd1913f98ab4"; logging-data="4304"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ZOg4Z3Bti0uM4g6QnrrlWYM+8Wx855R8=" User-Agent: Pan/0.136 (I'm far too busy being delicious; GIT 926a150 git://git.gnome.org/pan2) Cancel-Lock: sha1:oH6CubOFjMR7VkQ2vNC36PpZR8g= Xref: csiph.com comp.lang.javascript:23488 On Sun, 09 Mar 2014 14:31:15 +0000, Stefan Ram wrote: > I plan to use > > T charset="UTF-8">
> as a general frame for such JavaScript teaching examples: It might be a good idea to add a type attribute to your script element. I see no closing tag for the html element. I believe it is suggested that a charset line should appear as early as possible, as it's presence may require that the document be reprocessed. This usually means that, as I understand it, best practice is for it to be the first element in the document head. Have you considered using a textarea as the output region, rather than an inline part of the document? Doing so would allow output from interactive elements on the page at some future point, and would allow you to separate the script code from the document structure. T

Output: