Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

defining object in javascript


  • Please log in to reply

#1
ggordie

ggordie

    Member

  • Member
  • PipPip
  • 40 posts
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:

document.alert("welcome gordie")

when i try to execute it i get a pop up saying:

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!
  • 0

Advertisements


#2
timinator

timinator

    Member

  • Member
  • PipPip
  • 18 posts
The .js file is being executed by the Windows Script Host, not a a browser,
so there is no document object. Take a look at Microsoft's scripting site for further info: http://msdn.microsof.../scriptinga.asp

As a quick tip to get you started, what you want instead is this:
WScript.Echo("welcome gordie")
  • 0

#3
ggordie

ggordie

    Member

  • Topic Starter
  • Member
  • PipPip
  • 40 posts
thankl you, i'll read up. the only reason i was using an alert was for experament purposes, not because that's what i wanted, what i want is going to be alot more complex. it's going to determine the time and greet me acccordingly, with prerecorded greetings.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP