Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #23468
| Message-ID | <5561451.XZF3TQV4AJ@PointedEars.de> (permalink) |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Organization | PointedEars Software (PES) |
| Date | 2014-03-09 00:39 +0100 |
| Subject | Re: JavaScript in a PRE element of an HTML document |
| Newsgroups | comp.lang.javascript |
| References | <JavaScript-20140308234930@ram.dialup.fu-berlin.de> |
Stefan Ram wrote: > Is it alright to have a script in <code><pre>...</pre></code> > as in the following text that is intended to be an HTML5 document? > > <!DOCTYPE HTML><html><head><title>T</title><meta > charset="UTF-8"></head><body><code><pre><script> var a = 5; > document.writeln( a + 1 ); > document.writeln( a ); > </script></pre></code></body> <http://validator.w3.org/> > Anything else that is wrong with the above page There is no page. > (except for that the first line might be deemed too long)? Do not use consecutive document.writeln() or document.write(); write joined string Arrays or strings once instead. Avoid document.writeln() and document.write(); use .appendChild() & friends instead. -- PointedEars FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/> Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.
Back to comp.lang.javascript | Previous | Next | Find similar | Unroll thread
Re: JavaScript in a PRE element of an HTML document Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-03-09 00:39 +0100
csiph-web