Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #23468 > unrolled thread

Re: JavaScript in a PRE element of an HTML document

Started byThomas 'PointedEars' Lahn <PointedEars@web.de>
First post2014-03-09 00:39 +0100
Last post2014-03-09 00:39 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.javascript

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: JavaScript in a PRE element of an HTML document Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-03-09 00:39 +0100

#23468 — Re: JavaScript in a PRE element of an HTML document

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2014-03-09 00:39 +0100
SubjectRe: JavaScript in a PRE element of an HTML document
Message-ID<5561451.XZF3TQV4AJ@PointedEars.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.

[toc] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web