How to use WSH object in js file called from Html file 
Author Message
 How to use WSH object in js file called from Html file

Hi,

I have a javascript file which contains functions and one of them is used to
open a IE using WScript.CreateObject.
I included this javascript file in a html file in which I called this
function, I got the following error :

Error : 'WScript' is undefined

Any help.

Thanks.



Mon, 24 Oct 2005 04:05:54 GMT  
 How to use WSH object in js file called from Html file
Since Wscript is the host of the Wscript object, as you
wrote it, it cannot work when hosted by IE (HTML).  Try
using JScript's object (which is the same in IE)
instead ...

  var myobj = new ActiveXObject('..');

You will still run into a security issue, but it won't be
a coding problem.

Tom Lavedas
===========

Quote:
>-----Original Message-----
>Hi,

>I have a javascript file which contains functions and one
of them is used to
>open a IE using WScript.CreateObject.
>I included this javascript file in a html file in which I
called this
>function, I got the following error :

>Error : 'WScript' is undefined

>Any help.

>Thanks.

>.



Mon, 24 Oct 2005 05:04:47 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Calling VBS file from JS file

2. using jar file to store JavaScript (.js) files

3. Include JS file from JS file

4. EXE File called from an HTML file

5. including js file inside an js file

6. How to use JScript file (using WScript object) inside HTML codeWScript

7. calling js file from inside code

8. How to call js file function?

9. Calling a vbs-function from js in a wsf-script file

10. calling document.write from external .js file

11. js : extract TITLE string from an HTML file openned with OpenAsTextStream

12. .JS Files - Problem with linking HTML documents (Path)

 

 
Powered by phpBB® Forum Software