On Mon, Jun 25, 2012 at 12:12 AM, Alexander Farber <[email protected]> wrote: > Hello, > > I'm a complete node.js newbie and trying to run a program, but get this > error: > > #node ./app.js > > /home/afarber/src/Pocket-Island/build/app.js:1 > window.wooga.cas > ^ > ReferenceError: window is not defined > at Object.<anonymous> > (/home/afarber/src/Pocket-Island/build/app.js:1:63) > at Module._compile (module.js:446:26) > at Object..js (module.js:464:10) > at Module.load (module.js:353:31) > at Function._load (module.js:311:12) > at Array.0 (module.js:484:10) > at EventEmitter._tickCallback (node.js:190:38) > > I'm probably missing something obvious, does anybody please have a hint for > me? > > I've provided more details at > http://stackoverflow.com/questions/11181562/referenceerror-window-is-not-defined
That's because there is no window object. You're not in the browser anymore, Toto. Even if there were a window object, your example would need to be rewritten as `window.wooga && window.wooga.cas` to guard against the possibility that the windows object doesn't have a .wooga property. Now, I don't want to sound like an ass but the above is Javascript 101 and the mailing list is not really the place for that. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
