serverside-javascript

pros and cons of serverside javascript implementation?

老子叫甜甜 提交于 2019-11-28 04:25:10
I just started experimenting with Aptana Jaxer server side javascript engine for my next project. And i have few quesions about that By using server side JS, can we implement the whole web application without using any server side languages (like C#,java etc). Or server side JS sits in between the web server and other langauge stack. Is it really a better approach ?? what are the advandages and disadvandages? how this works well in terms of performance? is there any real time implementation (public websites) only using server side JS(no other languages)? what are the alternatives available

Node.js and CPU intensive requests

一世执手 提交于 2019-11-27 16:33:46
I've started tinkering with Node.js HTTP server and really like to write server side Javascript but something is keeping me from starting to use Node.js for my web application. I understand the whole async I/O concept but I'm somewhat concerned about the edge cases where procedural code is very CPU intensive such as image manipulation or sorting large data sets. As I understand it, the server will be very fast for simple web page requests such as viewing a listing of users or viewing a blog post. However, if I want to write very CPU intensive code (in the admin back end for example) that

How to convert character encoding from CP932 to UTF-8 in nodejs javascript, using the nodejs-iconv module (or other solution)

喜夏-厌秋 提交于 2019-11-27 15:16:59
问题 I'm attempting to convert a string from CP932 (aka Windows-31J) to utf8 in javascript. Basically I'm crawling a site that ignores the utf-8 request in the request header and returns cp932 encoded text (even though the html metatag indicates that the page is shift_jis). Anyway, I have the entire page stored in a string variable called "html". From there I'm attempting to convert it to utf8 using this code: var Iconv = require('iconv').Iconv; var conv = new Iconv('CP932', 'UTF-8//TRANSLIT/

Using a .NET DLL in Node.js / serverside javascript

我们两清 提交于 2019-11-27 10:39:14
I have a pet project that is an online game, the entire game engine is written in C# and I would like to know if there is anyway I can call the functions of this existing assembly (.dll) from a solution built using Node.JS, Socket.IO, Express etc? The game engine itself is pretty complete; tested and robust. I am hoping there is some neat way of exposing its functionality without too much overhead. UPDATE : To answer my own question a little.. I have ended building my own web socket server (based on the most current web socket protocol document). It is written in C# and compiled using Mono so

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

人盡茶涼 提交于 2019-11-27 10:03:01
Possible Duplicate: How to decide when to use Node.js? Sorry if I'm a bit ambiguous, but I'm trying to understand the real advantages of using Node.js instead of other server-side language. I'm a JavaScript enthusiast, so I'm probably going to play with Node.js, but I want to know if I should use it in my projects. Raynos 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)

Preventing XSS in Node.js / server side javascript

ぃ、小莉子 提交于 2019-11-27 09:19:01
问题 Any idea how one would go about preventing XSS attacks on a node.js app? Any libs out there that handle removing javascript in hrefs, onclick attributes,etc. from POSTed data? I don't want to have to write a regex for all that :) Any suggestions? 回答1: One of the answers to Sanitize/Rewrite HTML on the Client Side suggests borrowing the whitelist-based HTML sanitizer in JS from Google Caja which, as far as I can tell from a quick scroll-through, implements an HTML SAX parser without relying on

Why does the JavaScript need to start with “;”?

丶灬走出姿态 提交于 2019-11-27 09:02:18
问题 I have recently noticed that a lot of JavaScript files on the Web start with a ; immediately following the comment section. For example, this jQuery plugin's code starts with: /** * jQuery.ScrollTo * Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com * Dual licensed under MIT and GPL. * Date: 9/11/2008 .... skipping several lines for brevity... * * @desc Scroll on both axes, to different values * @example $('div').scrollTo( { top: 300, left:'+=200'

pros and cons of serverside javascript implementation?

北慕城南 提交于 2019-11-27 05:20:04
问题 I just started experimenting with Aptana Jaxer server side javascript engine for my next project. And i have few quesions about that By using server side JS, can we implement the whole web application without using any server side languages (like C#,java etc). Or server side JS sits in between the web server and other langauge stack. Is it really a better approach ?? what are the advandages and disadvandages? how this works well in terms of performance? is there any real time implementation

What is the correct way to chain async calls in javascript?

风格不统一 提交于 2019-11-27 01:13:32
问题 I'm trying to find the best way to create async calls when each call depends on the prior call to have completed. At the moment I'm chaining the methods by recursively calling a defined process function as illustrated below. This is what I'm currently doing. var syncProduct = (function() { var done, log; var IN_CAT = 1, IN_TITLES = 2, IN_BINS = 3; var state = IN_CAT; var processNext = function(data) { switch(state) { case IN_CAT: SVC.sendJsonRequest(url("/api/lineplan/categories"),

Node.js and CPU intensive requests

拥有回忆 提交于 2019-11-26 22:27:57
问题 I've started tinkering with Node.js HTTP server and really like to write server side Javascript but something is keeping me from starting to use Node.js for my web application. I understand the whole async I/O concept but I'm somewhat concerned about the edge cases where procedural code is very CPU intensive such as image manipulation or sorting large data sets. As I understand it, the server will be very fast for simple web page requests such as viewing a listing of users or viewing a blog