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


Groups > comp.lang.javascript > #13199

Re: A way of displaying an active Script

Message-ID <9015391.7lMVvsVivV@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2012-04-03 21:17 +0200
Subject Re: A way of displaying an active Script
Newsgroups comp.lang.javascript
References <KFY94oUiriePFw3k@invalid.uk.co.demon.merlyn.invalid> <8phmn7poe06lnu5d95na71afnkjvkted1e@4ax.com>
Followup-To comp.lang.javascript

Followups directed to: comp.lang.javascript

Show all headers | View raw


Dr.Kral@nyc.rr.com wrote:

> Dr J R Stockton [wrote]:
>> I thought I'd try this, without much hope. It works in Firefox Opera
>> Safari & Chrome; in IE8, the script is executed but not shown.  IE 9/10 ?
>  Works in IE 9
> 
> This even works in IE5.5!
> 
> 
> <!doctype HTML>
> <head>
> <title>test</title>
> </head>
> <body>
> aaa
> <script type="text/javascript" id="scbk">
> A = 5 + 7+ "this is a script"
> 
document.writeln(navigator.userAgent+"<br>"+document.getElementById("scbk").innerHTML+"<br>"+A);
> </script>"
> zzz
> </body>

0.   Declare `A'.
0.1. Append a semicolon to the script's first line (yes, it is an example;
     a bad one).
1.   Drop document.writeln() in favor of document.write() or methods 
     introduced with W3C DOM Level 2 (which IE/MSHTML supports from version
     5.0 on).
2.   If you use document.write(), escape at least the `<' in the generated
     script code.  If you use the new methods, nothing needs to/must be
     escaped, though.
3.   Remove the extra `"'.

Please do not post attribution novels, and get a real name.


PointedEars
-- 
> If you get a bunch of authors […] that state the same "best practices"
> in any programming language, then you can bet who is wrong or right...
Not with javascript. Nonsense propagates like wildfire in this field.
  -- Richard Cornford, comp.lang.javascript, 2011-11-14

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


Thread

A way of displaying an active Script Dr J R Stockton <reply1214@merlyn.demon.co.uk.not.invalid> - 2012-04-02 23:40 +0100
  Re: A way of displaying an active Script Dr.Kral@nyc.rr.com - 2012-04-03 14:58 -0400
    Re: A way of displaying an active Script Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-04-03 21:17 +0200
      Re: A way of displaying an active Script John G Harris <john@nospam.demon.co.uk> - 2012-04-04 15:50 +0100
        Re: A way of displaying an active Script Dr J R Stockton <reply1214@merlyn.demon.co.uk.not.invalid> - 2012-04-05 20:05 +0100
          Re: A way of displaying an active Script Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2012-04-06 10:39 +0200
            Re: A way of displaying an active Script "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-04-06 15:03 +0000
              Re: A way of displaying an active Script Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2012-04-06 21:20 +0200
                Re: A way of displaying an active Script "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-04-06 19:45 +0000
                [OT] Re: A way of displaying an active Script Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2012-04-06 22:39 +0200
                Re: [OT] Re: A way of displaying an active Script "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-04-06 22:18 +0000
                Re: [OT] Re: A way of displaying an active Script Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2012-04-07 00:40 +0200
                Re: [OT] Re: A way of displaying an active Script Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2012-04-07 02:33 +0200
                Re: [OT] Re: A way of displaying an active Script Dr J R Stockton <reply1214@merlyn.demon.co.uk.not.invalid> - 2012-04-07 19:25 +0100
                Re: [OT] Re: A way of displaying an active Script "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-04-08 07:38 +0000
                Re: A way of displaying an active Script Dr J R Stockton <reply1214@merlyn.demon.co.uk.not.invalid> - 2012-04-07 19:20 +0100
                Re: A way of displaying an active Script "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-04-08 07:52 +0000
  Re: A way of displaying an active Script Gene Wirchenko <genew@ocis.net> - 2012-04-03 12:44 -0700
    Re: A way of displaying an active Script Dr J R Stockton <reply1214@merlyn.demon.co.uk.not.invalid> - 2012-04-04 20:30 +0100
      Re: A way of displaying an active Script Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2012-04-05 01:16 +0200
        Re: A way of displaying an active Script Dr J R Stockton <reply1214@merlyn.demon.co.uk.not.invalid> - 2012-04-06 21:42 +0100
          Re: A way of displaying an active Script Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2012-04-07 01:11 +0200
            Re: A way of displaying an active Script Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-04-07 01:52 +0200
            Re: A way of displaying an active Script Dr J R Stockton <reply1214@merlyn.demon.co.uk.not.invalid> - 2012-04-08 19:48 +0100
              Re: A way of displaying an active Script "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2012-04-09 08:17 +0300
                Re: A way of displaying an active Script Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2012-04-09 09:06 +0000
          Re: A way of displaying an active Script John G Harris <john@nospam.demon.co.uk> - 2012-04-07 11:21 +0100
            Re: A way of displaying an active Script Tim Streater <timstreater@greenbee.net> - 2012-04-07 12:26 +0100
              Re: A way of displaying an active Script John G Harris <john@nospam.demon.co.uk> - 2012-04-07 15:16 +0100

csiph-web