serverside-javascript

Is there a way to test circular reference in JavaScript?

会有一股神秘感。 提交于 2019-12-17 18:29:10
问题 I'm making a game, and I've come across a problem... When I try to save, JSON fails and reports that circular reference is being made somewhere. I don't think it actually is, I can't see it, so is there an algorithm or anything which could tell me where it is exactly (between which objects and stuff)? Also, is there a JSON alternative that can save circular reference? I'm running a node.js server, I saw this, but I can't get it to work (it's not made as a module i can require() in my code).

jsdom not loading or not running external scripts in page

无人久伴 提交于 2019-12-14 03:50:53
问题 Cross-posted from https://github.com/tmpvar/jsdom/issues#issue/127 I will post a minimal test case in the next day or so - but I wanted to see if anyone else had the same problem - or if (more likely) if I am doing something stupid. I'm using NodeJS v2.6 on Ubuntu 10.04 AMD64 and jsdom@0.1.23. var file = readFileSync("./www/index.html", "utf8"); var window = jsdom.jsdom(file).createWindow(); All inline scripts run, but complain about missing variables which should be supplied by the external

call nodejs scripts from html pages

耗尽温柔 提交于 2019-12-11 17:37:39
问题 I would like to call node.js scripts like i do with php, that is simply using their url. I'm mainly a js programmer, so it would be wonderful for me to ditch out php totally and use node for the server side scripting. But most of the tutorial i saw until now involved creating a server, etc... I just want to call a script in the old way, like www.mysite.com/login.js instead of www.mysite.com/login.php And once called the script should return or a page for rendering or simply json or other text

Is there a Server Side Javascript engine for IIS?

时间秒杀一切 提交于 2019-12-11 17:36:55
问题 I am looking for a solution similar to Aptana's Jaxer where I can execute javascript server side. 回答1: Check out http://nodejs.org/. It uses the V8 Engine which is the fastest javascript engine. 回答2: You have ASP JScript which works on IIS on the server-side. Its almost like standard JavaScript. 来源: https://stackoverflow.com/questions/1991822/is-there-a-server-side-javascript-engine-for-iis

JavaScript Multi-statement Transaction in Marklogic

喜欢而已 提交于 2019-12-11 15:27:11
问题 I wanted to write a multi-statement transaction in server-side JavaScript in marklogic. What I wanted to achieve is, do an update transaction and then write a query statement which queries for the updated document and confirm that the update is visible within the transaction and finally do a rollback. By doing the rollback, I wanted to confirm that the update made within the transaction is not visible outside the transaction and it is visible within the transaction. I wrote a code both in

Confirmation box from server side in asp.net

随声附和 提交于 2019-12-10 19:56:47
问题 I want to show the confirmation box in asp.net from server side: I want to call it from server side because I have to take the customer message from server side. I am using the below code string str = "Are you sure, you want to Approve this Record?"; ClientScript.RegisterStartupScript(typeof(Page), "Popup", "return confirm('" + str + "');",true); // More code .... Now it is showing the popup and irrespective of what I click, whether "ok" or "Cancel", my code is executing. Please let me know

Web Frameworks & Available Libraries: Is it a brave move to opt for Node.js instead of Python?

让人想犯罪 __ 提交于 2019-12-10 12:01:51
问题 I have quite sometime now (a month or two) before I can actually start learning a web programming language; so I am still worrying about what language to learn. Whatever programming language I choose, I'd also have to learn JavaScript alongside that language as it's the go to for client-side scripting. I am looking at: (1) Python, Ruby, JavaScript (Node.js -- server-side & jQuery -- client-side); (2) DBMS - PostgreSQL (3) I am going to learn C/C++ anyway (but after I learn a high-level

Scripting with Server-side Javascript

喜欢而已 提交于 2019-12-09 19:06:52
问题 What is a good server-side javascript implementation for writing both one-off scripts to handle some task or writing automation scripts to be used over and over. I am intrigued by the ability for SSJS to scrape webpages with such ease and am thinking SSJS could replace Python for my generic scripting needs. Is there a SSJS implementation for such things? 回答1: If you're familiar with jQuery, then node.js (with the plugins "request", "jsdom", and a port of jquery) let's you easily scrape web

Can you call COM components from server side javascript?

蓝咒 提交于 2019-12-07 22:44:33
问题 Is it possible (using one of the server side implementations of javascript .. see http://www.nakedjavascript.com/getting-started-55) to instantiate a COM object and invoke methods on it? 回答1: There is node-win32ole ( npm install win32ole ). 回答2: That depends on which server-side implementation you’re using. When using ASP/JS (or any other framework using Microsoft’s Windows Scripting engine), that’s not a problem using the ActiveXObject constructor. When using JSDB, you can use the ActiveX

JSON object vs window variable for passing server-side rendered initial state using reactjs

不想你离开。 提交于 2019-12-06 10:14:06
In an isomorphic application with Reactjs, you need to pass the identical initial state that was rendered on the server down to the client (which will then 'rehydrate' the app with event bindings and such). I've seen two approaches to passing this initial state down-- Setting a global variable to the window: <script> window.initialState = {{JSON.stringify(initialState)}} ; </script> Or passing it as a JSON object: <script id="initial-state" type="application/json"> {{JSON.stringify(initialState)}}</script> Both are easily retrievable from anywhere in the application. Are there any advantages