Hello,
I had heard that there was server-side JavaScript, but knew nothing
about it until today when I found the websites:
http://www.hongkiat.com/blog/node-js-server-side-javascript/ and
http://nodejs.org/
I downloaded v0.6.18 onto my Windows Vista computer from the second
link and got the console prompt to work.
On type something like:
var a = 5;
var b = 6;
a + b;
I get the message "undefined" after the first two lines, but it still
works and gives the result as 11.
If I replace the last line by console.log(a+b);
I also get 11, but this is again followed by "undefined". Why am I
getting these messages?
Of rather more significance, if I create a file called helloworld.js,
and put in the file the line console.log("Hello World"); then type
"node helloworld.js", the prompt displays "..." then hangs, as if it
is waiting for something more, and cannot find the file. On typing
process.cwd() I am sure I am in the correct directory with the test
file.
Is there some path that has to be set so that Node can find the test
file, and how do I get rid of the "undefinded" replies?
Node looks very interesting, but until these issues are resolved, I
cannot move on, and would be most grateful for some help.
csharp.com