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


Groups > comp.lang.javascript > #33481

Re: Standalone Jscript script

From Martin Honnen <martin.honnen@gmx.de>
Newsgroups comp.lang.javascript
Subject Re: Standalone Jscript script
Date 2017-06-01 18:04 +0200
Organization Liberty Development
Message-ID <ogpdu7$6e7$1@news.albasani.net> (permalink)
References <ogparl$u3g$1@dont-email.me>

Show all headers | View raw


On 01.06.2017 17:15, Dave "Crash" Dummy wrote:
> Although I work mostly with VBScript I have no problem writing
> Javascript scripts for web pages. What I can't do is get the simplest
> standalone jscript to run in Windows 10:
> 
> test.js
> -----------------
> alert("Hello, World!");
> -----------------
> 
> I get an error for "object required."
> 
> If I try
> window.alert("Hello, World!");
> 
> or
> document.alert("Hello, World!");
> 
> I get a window or document undefined error. The only thing I
> can get to work is a HTA workaround kluge:
> 
> test.hta
> --------------
> HTA:Application windowstate="minimize" showintaskbar="no">
> <script type="text/jscript">
> alert ("Hello, World!");
> self.close();
> </script>
> ---------------
> 
> What am I missing?


Well, the JScript ActiveX engine you can use in Windows from the command 
line implements the ECMAScript edition 3 standard more or less, plus 
some Microsoft/Windows specific extensions to interact with VBScript. It 
is hosted in Windows Script Host when you run it from the command line: 
https://msdn.microsoft.com/en-us/library/9bbdkx3k(v=vs.84).aspx. It is 
also hosted in classic ASP pages and used to be hosted in IE until 
Microsoft decided that the old engine meant to cater for different 
environments (like IE, ASP, WSH) wasn't up to compete with the featured 
like JIT compilation introduced in the engines used in other browsers.


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


Thread

Standalone Jscript script "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-06-01 11:15 -0400
  Re: Standalone Jscript script Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-06-01 16:41 +0100
  Re: Standalone Jscript script "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-06-01 17:47 +0200
    Re: Standalone Jscript script "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-06-01 12:02 -0400
  Re: Standalone Jscript script Martin Honnen <martin.honnen@gmx.de> - 2017-06-01 18:04 +0200
  Re: Standalone Jscript script Dr J R Stockton <reply1700@merlyn.demon.co.uk.invalid> - 2017-06-02 22:26 +0100

csiph-web