When and how do you use server side JavaScript? [closed]

It’s not AJAX, unless people are using the term improperly. As its name suggests, SSJS is JavaScript that runs on the server, interpreted by a standalone (i.e., browser-independent) JavaScript engine, like SpiderMonkey. Why bother? Well, one area I currently see it underutilized in is in data validation. With SSJS you write one piece of code … Read more

Why and when to use Node.js? [duplicate]

It’s evented asynchronous non-blocking I/O build ontop of V8. So we have all the performance gain of V8 which is the Google JavaScript interpreter. Since the JavaScript performance race hasn’t ended yet, you can expect Google to constantly update performance on V8 (for free). We have non-blocking I/O which is simply the correct way to … Read more

Send message to specific client with socket.io and node.js

Ivo Wetzel’s answer doesn’t seem to be valid in Socket.io 0.9 anymore. In short you must now save the socket.id and use io.sockets.socket(savedSocketId).emit(…) to send messages to it. This is how I got this working in clustered Node.js server: First you need to set Redis store as the store so that messages can go cross … Read more