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


Groups > comp.lang.javascript > #23485

Re: JavaScript in a PRE element of an HTML document

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 "Jukka K. Korpela" <jkorpela@cs.tut.fi>
Newsgroups comp.lang.javascript
Subject Re: JavaScript in a PRE element of an HTML document
Date Sun, 09 Mar 2014 19:25:59 +0200
Organization A noiseless patient Spider
Lines 18
Message-ID <lfi878$5pu$1@dont-email.me> (permalink)
References <JavaScript-20140308234930@ram.dialup.fu-berlin.de> <lfgsk3$hlv$1@dont-email.me> <teaching-frame-20140309152656@ram.dialup.fu-berlin.de> <lfi00o$4mi$1@dont-email.me> <script-20140309161947@ram.dialup.fu-berlin.de>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Sun, 9 Mar 2014 17:26:00 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="ad9d9996ed56b0226e850b84acbddfdf"; logging-data="5950"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nR3fwZ5dyA/NOOLFuOLV7"
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
In-Reply-To <script-20140309161947@ram.dialup.fu-berlin.de>
X-Antivirus-Status Clean
X-Antivirus avast! (VPS 140309-0, 09.03.2014), Outbound message
Cancel-Lock sha1:ibPq0IoP5S1B5Q4gmXmNybJEN4Q=
Xref csiph.com comp.lang.javascript:23485

Show key headers only | View raw


2014-03-09 17:35, Stefan Ram wrote:

> "Jukka K. Korpela" <jkorpela@cs.tut.fi> writes:
>> The <script> element will be parsed and executed
>
>    Yes, this was my intention. (I already know how to display
>    the source code, but was wondering whether it was
>    technically correct to execute it within a pre element.)

Oh. Yes, it is technically correct to put <script> inside <pre>. But I 
don't think it's a good idea. You would anyway have to have two copies 
of the script code if you wish to show both the code and its results, so 
you could just as well have it in a variable. Or you could have code 
that copies the content of a <script> element into a visible element.


-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: JavaScript in a PRE element of an HTML document "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-03-09 07:01 +0200
  Re: JavaScript in a PRE element of an HTML document "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-03-09 17:05 +0200
    Re: JavaScript in a PRE element of an HTML document Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-03-09 17:15 +0100
    Re: JavaScript in a PRE element of an HTML document "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-03-09 19:25 +0200
      Re: JavaScript in a PRE element of an HTML document "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-09 19:44 +0100
    Re: JavaScript in a PRE element of an HTML document Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-03-10 18:01 +0000
      Re: JavaScript in a PRE element of an HTML document "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-11 09:59 +0100
  Re: JavaScript in a PRE element of an HTML document Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-03-09 16:54 +0100
  Re: JavaScript in a PRE element of an HTML document Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-09 16:30 +0000
  Re: JavaScript in a PRE element of an HTML document Denis McMahon <denismfmcmahon@gmail.com> - 2014-03-09 22:16 +0000
    Re: JavaScript in a PRE element of an HTML document "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-03-10 07:30 +0200

csiph-web