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

From "Jukka K. Korpela" <jkorpela@cs.tut.fi>
Newsgroups comp.lang.javascript
Subject Re: JavaScript in a PRE element of an HTML document
Date 2014-03-09 19:25 +0200
Organization A noiseless patient Spider
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>

Show all headers | 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