473,387 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Can't Open .js File w/ Script Host Error

Hello.

I posted this earlier with the full code of the JavaScript file I'm trying to
open. I'm posting this again, because the file is not the problem.

I seem to be having a 'windows' problem w/ Window Script Host. While this is
more of a computer support based problem, I was hoping that someone had any
knowledge on how to resolve this situation. The error message I'm getting is:
Line: 5
Char: 1
Error: 'document' is undefined
Code: 800A1391
Source: Microsoft JScript Runtime Error

Is there any idea on how to resolve this?

--
Message posted via http://www.webmasterkb.com

Aug 10 '08 #1
2 12703
"LayneMitch via WebmasterKB.com" <u39402@uwewrote in
news:88792a5bc9408@uwe:

message I'm getting is:
Line: 5
Char: 1
Error: 'document' is undefined
Code: 800A1391
Source: Microsoft JScript Runtime Error

Is there any idea on how to resolve this?
It seems vaguely familiar. I am sure it is one of those simple errors where
you end up batting the side of your head after you find the problem.

Clear all your cache, make sure that file names are consistent regarding
case if your server is not Windows-based, and then see if you get the same
error using firefox. Chances are, the FF error console will give you a much
more meaningful message.

You might also give us the link so that we can look at it ourselves. (i.e.
do not put the code here, put it into an isolated area on your server or
even a dedicated server.
Aug 11 '08 #2
LayneMitch via WebmasterKB.com wrote:
>
I posted this earlier with the full code of the JavaScript file I'm trying to
open. I'm posting this again, because the file is not the problem.
The problem is what you're doing with the file.
I seem to be having a 'windows' problem w/ Window Script Host.
I wouldn't call it a "'windows' problem" (which I assume means "a
problem with the Windows operating system"). The problem is that
you're using Windows (not "Window") Script Host to try to execute
ECMAScript code that's written for a different environment (a browser).

You have downloaded some ECMAScript and saved it as a file, with the
".js" extension. (Apparently "typedcore.js", based on your previous
thread.) The default handler for that extension in your copy of
Windows is very likely one of the WSH launchers (probably
wscript.exe). That means if you ask Windows to execute "typedcore.js"
- from a command prompt, for example - Windows will run wscript.exe
with "typedcore.js" as a command-line argument.

WSH has an ECMAScript engine - Microsoft's JScript. That lets you run
ECMAScript programs under WSH: you can use ECMAScript as a Windows
scripting language, in other words. The WSH JScript engine has various
extensions that allow you to manipulate Windows OS objects. What it
does not have, since it is not running in a browser, is the HTML DOM.
Thus it will not run typical ECMAScript functions written to run in a
browser window, because they generally want to operate on the DOM.

If you see a WSH error, you're asking Windows to execute your
ECMAScript under WSH. Don't do that, unless you're trying to learn WSH
scripting with JScript.

If you want to experiment with ECMAScript on web pages (the
environment where the vast majority of it is used), you need to have a
browser load typedcore.js as a script. That generally means including
it in an HTML document, either inline or as a URI reference, using a
SCRIPT element.

(There are alternatives, such as the "JavaScript Shell" that's
available for Firefox, which provides a command for loading ECMAScript
interactively. But we'll stick with the common case here.)

So what you need is an HTML page with a SCRIPT element that has the
value of its SRC attribute set to a *valid URL* for your ECMAScript
source file. You posted some HTML source in the other thread that
almost accomplished that, but it had an invalid URL for the script
source. (It wasn't great HTML - no DOCTYPE, for example, and I'd put
*some* content in the body so that you can be sure you're loading what
you think you're loading - but it should do.)

So fix the value of that SRC attribute. David Mark already gave you
the best suggestion: put typedcore.js in the same directory as the
HTML file, and use just "typedcore.js" as the URL. Then open the HTML
file in your browser.

--
Michael Wojcik
Micro Focus
Rhetoric & Writing, Michigan State University
Aug 13 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Aggelos I. Orfanakos | last post by:
Hello. Under Gentoo Linux, I issue: $ python timeit.py python: can't open file 'timeit.py' $ ls -al /usr/lib/python2.3/timeit.py -rw-r--r-- 1 root root 9833 Oct 19 02:17...
8
by: Mathieu Blais | last post by:
Hi, I need to capture the Script timeout error if that is possible. I know I can increase the timeout value in the server settings or in the scripts itself but I really want to make sure that no...
1
by: Andy Fish | last post by:
Hi, I read in the mysql manual that it's possible to copy the 'frm' files from one mysql server to another, but when I try to do this I get the error "Can't open file: 'mytable.ibd' (errno: 1)"...
1
by: William Starr Moake | last post by:
Another problem with the browser-based WYSIWYG editor I'm trying to assemble using IE's design mode. This opens the selected page in the editor iframe named iView: <select name="template"...
3
by: Murasama | last post by:
Hi there, Im trying a simple file IO operation in Visual Studio .NET 2003 and it can't seem to open the file. If I run the exe in the debug directory it works fine but if I click the start...
4
by: nickyeng | last post by:
i have main program, which user key in the filename in command line argument. i pass the argument to another class constructor to handle it. I have the filename correct, but it still give me...
0
by: Apocalypse | last post by:
I have installed Visual Studio 2005 just now. When I compile and link a empty console application : #include "stdafx.h" int _tmain(int argc, _TCHAR* argv) { return 0; } There is an Link...
0
by: adolfo | last post by:
I tried reinstalling the program and the DISLIN/PYTHON SETUP window showed up with the OK button almost covered by the cancel button. The window is too small so I extend the edges but the...
1
by: sdsjohnny | last post by:
I have a weird issue. Can some one help. When I hardcode abc.bin to inputFileName - I can open the file in cpp. But when I pass the same using an optional argument, it fails. Note that in both...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.