There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen blue screen of death boot computer connection crash css dell display driver drivers email error firefox firefox 3 game hard drive internet internet explorer itunes laptop lcd linux malware monitor network networking outlook outlook 2003 outlook express partition password printer problem problems ram router security slow software sound trojan usb virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
javascript object problem


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
ggordie's Avatar
Senior Member with 121 posts.
 
Join Date: Jul 2005
Location: palm harbor
Experience: Intermediate
20-Aug-2005, 09:25 PM #1
javascript object problem
i'm trying to script a greeting that will execute on my computer on startup. the problem is, i dont know what object to use, because i'm not linking the js file to an html file, i'm executing it just as a js file because i dont a window opening as well as a popup.

here's my code:

Code:
document.alert("welcome gordie")
when i try to execute it i get a pop up saying:

Quote:
script: c:\documents and settings\ ... \startup\welcome.js
line: 2
char: 1
error: 'document' is undefined
code: 800A1391
source: microsoft jscript runtime error
thanks alot!
__________________

my site
Shadow2531's Avatar
Distinguished Member with 2,629 posts.
 
Join Date: Apr 2001
27-Aug-2005, 07:07 AM #2
Like this?

WScript.Echo("Welcome Gordie");
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
27-Aug-2005, 07:33 PM #3
You're not opening it in an HTML document, hence there is no "document" object to reference. The WScript.echo thing should work fine, assuming you have Windows Scripting Host enabled.
ggordie's Avatar
Senior Member with 121 posts.
 
Join Date: Jul 2005
Location: palm harbor
Experience: Intermediate
27-Aug-2005, 08:16 PM #4
so basically WScript replaces document... otherthan that, can i use normal javascript?
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
27-Aug-2005, 08:20 PM #5
You can use WSH/WScript to run JavaScripts..so yes, basically.
http://msdn.microsoft.com/library/de...ingscripts.asp
ggordie's Avatar
Senior Member with 121 posts.
 
Join Date: Jul 2005
Location: palm harbor
Experience: Intermediate
27-Aug-2005, 09:08 PM #6
thanks a lot!
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:14 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.