You can't use WScript class outside of the script Host, i.e. running as a
straight .js or .vbs file not in IE or an ASP scenario.
Assuming the browser security settings are set to allow unsafe ActiveX,
otherwise you'll get a 'couldn't create object' error, you need:
WshShell = new ActiveXObject("WScript.Shell");
then as before.
Joe
----- Original Message -----
From: <True2ViSioN@a...>
To: "javascript" <javascript@p...>
Sent: Friday, March 29, 2002 10:34 PM
Subject: [javascript] WScript - Window Scripting Host - WshShell
how to insert into a document
here is what i got in the .js file
WshShell = WScript.CreateObject("WScript.Shell");
function format()
{
WshShell.popup("Format all of Power-Pads settings?", 0, "Power-Padâ?¢", 4);
}
i load it into my main file like this
<Script Language="javascript" SRC="file.js"></Script>
and do an onclick="format"
what is it that I am doing wrong?
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20