JavaScript is the original and common name applied towards most flavors of a scripting language that originated on NetScape Navigator. Use this tag for questions regarding common implementations of ECMAScript, JavaScript, JScript, etc. JS does not typically refer to its ECMA-cousin, ActionScript.

learn more… | top users | synonyms (1)

4
votes
0answers
594 views

Client side authentication through signatures instead of passwords

I want to save some user-generated data with some signature of the user that generated it (let's say that the user has to fill some forms with some data and I want him to sign the written data). The ...
3
votes
0answers
97 views

Tips for optimizing javascript code. a year's worth of Dates

I am playing around with the date object, i made a function that generates a bunch of dates, and applies some function on each date. For a month's worth, it is fine about 2.5ms on my pc, ff and ...
3
votes
0answers
368 views

How to avoid module dependency chain nightmare caused by transitive dependencies?

Many (most?) AngularJS folks seem to advocate for breaking AngularJS apps up into many modules. Brian Ford in his blog already states that packaging by layer (controller, service, etc.) is a "silly" ...
3
votes
0answers
325 views

Reducing code complexity for an interface between angular and d3

I'm playing around with different ways of integrating d3 and angular, in the context of learning both of these frameworks, and am hoping for some input: My client application receives a JSON array ...
2
votes
0answers
52 views

Dealing with conditional verification logic using guard assertion

I have parametrized test with 2 variants: NULL value and any NOT NULL value From this value is depends one assert: In case NULL it should be checked if object has field1 with value1 In ...
2
votes
0answers
103 views

Best way to verify that a user has completed a task on another website.

We are developing a website for students on which they first have to fulfill specific tasks in order to use our service. The problem is, that those tasks are on another website, which has nothing to ...
2
votes
0answers
44 views

How to architect rule matching with multiple conditionals and outcomes

I'm working on allowing my users to create their own ruleset for data that's coming in. All of the data below is sample mock data and not in relation to our product. Example of a rule (there can be ...
2
votes
0answers
97 views

Javascript: How to get the Object an object is prototype of

Javascript in the DOM has a peculiar characteristic. There's a different Object object that an object (by default) inherits per window. In order to find what kind of object is being sent to a ...
2
votes
0answers
62 views

Suggestions for Storing large collection of related words

I am trying to create a simple sentence generator that uses templates and a database of words. It will be a website where essentially a user could click a button to generate a sentence. For example: ...
2
votes
0answers
111 views

Hot swapping files and metaprogramming with front-end JavaScript

I was inspired by a video on hotswapping JS files with React + Webpack for the web. I started trying it out with React + Backbone + RequireJS. Seems to work, as long as I stick to the stateless parts ...
2
votes
0answers
202 views

Authenticate Joomla user from an external app based on Node.js, Javascript and MongoDB

I have an iOS App which currently pulls in all the data from the MongoDB using a Node.js server. Currently my API / my node server handles all the data manipulation the iOS app/Swift only displays the ...
2
votes
0answers
104 views

Can/should objects share methods in certain circumstances?

I am currently working on a web application that is supposed to resemble an operating system with GUI (it manages processes and windows). I have several constructors which deal with different aspects ...
2
votes
0answers
257 views

How can I put multiple hierarchical forms in a single web page and avoid making it a mess?

We are a group of developers working on a web application that accepts forms filled and sent by our users and present it in an overall view. Our main form view looks like this: There are multiple ...
2
votes
0answers
280 views

JS closures - Passing a function to a child, how should the shared object be accessed

I have a design and am wondering what the appropriate way to access variables is. I'll demonstrate with this example since I can't seem to describe it better than the title. Term is an object ...
2
votes
0answers
56 views

How do I differentiate between old and new data in backbone collections?

A common pattern I come across is a backbone collection which is initially seeded from a database. However, the user can also add to the collection. When the user does add to the collection, these ...
2
votes
0answers
149 views

Managing setTimeouts and setInterval in a distributed environment

I am building a turnbased game on nodejs using socket.io and redis as the datastore. I am planning on hosting the game on AWS opsworks with the ability to scale by adding more nodes. How should I ...
2
votes
0answers
394 views

Should we still care about _escaped_fragment_ and alternate HTML generation for Single Page Applications?

A few months ago I started a project, which will have two parts – business client overview panel (AngularJS SPA) and public front-end (dynamic HTML with progressive enchancements via XHR). I'd really ...
2
votes
0answers
310 views

Should I use SignalR to synchronize & cache CRUD data to a mobile app?

I'm considering using SignalR to send data to a mobile app, but need to have a way to synchronize data while it's closed or pending updates. Is it a good idea to use Backbone.js <--> SignalR to ...
2
votes
0answers
235 views

What is a good method of storing test data for development and unit testing with angular and jasmine?

What is a good method of storing JSON data/objects for development and unit testing with angular and jasmine? I have seen some ways of accomplishing this. However, since I am new to unit testing with ...
2
votes
0answers
366 views

Reusable and customizable charting library on top of d3js

I have started building a charting library on top of d3js using javascript's inheritance. My goal is to develop reusable and fully customizable chart components. I read the article: Towards Reusable ...
2
votes
0answers
82 views

Reasoning behind indexedDB versioning

So, the last 2 weeks I have been fighting with indexedDB and one of two recurring questions that keep popping up is why indexedDB has to use/present it's entire versioning system? I do understand that ...
1
vote
0answers
14 views

Linking service and factory functions to controller $scopes in Angular

I'm trying to keep my controllers as thin as possible, so I keep my domain logic in services and factories. When I need to call a function in response to a user action like a click I assign the ...
1
vote
0answers
29 views

Dealing with stubbed external dependency

In sut I should I have two kinds of dependencies to be stubbed: 3rd party dependencies (mongodb & co) and own dependencies: var async = require('async'), // This dependency should not be stubbed ...
1
vote
0answers
545 views

Multi-page application using angularjs

I want to create a multi-page application using angularjs, because i want to make use of a lot of angularjs functionality, like two way binding, form validation, AJAX handling, etc. But I read from ...
1
vote
0answers
89 views

ModelState Validation vs JQuery vs Remote

I was stuck with some validations for quite a while. I have been thoroughly searching the internet to find ways to apply the validations I require. I came across many methods for validations even ...
1
vote
0answers
73 views

clone(serialize) v. serialize(clone)

My objects serialize() method is dependent on a call to its clone() method, because of its options to get rid of unwanted data without changing the original instance: serialize: function(opt_filters) ...
1
vote
0answers
84 views

Create 2D drawing with touch screen that also works in IE

I have a page the allows a user to create a signature using a touch screen or mouse. The touch screen works fine in Chrome but not in IE. Most of the time IE does not 'detect' that I am using a touch ...
1
vote
0answers
265 views

Why is deep plucking a bad idea?

Both underscore and lodash refuse to implement deep plucking, despite many requests from users and gists or modules that implement the feature. ...
1
vote
0answers
689 views

Preserving Pre-formatted Multi-Line Strings in Node.js Scripts

There is a lot I don't like about PHP, but one thing I love is multi-line strings: $query = <<<EOT select field1 ,field2 ,field3 from tableName where field1 = 123 EOT; ...
1
vote
0answers
34 views

modelling an ecosystem evolving on a landscape

I would like to understand a bit more the theory and the approaches available in modelling a population roaming across a landscape. Assume discrete time and space as simple as a discrete grid and a ...
1
vote
0answers
106 views

Need to add websocket support to a single page that's running a wsgi service

Current setup. I have a legacy ERP system (Thoroughbred) and i then have several in house applications (CRM, WMS) and a website that interact with it via an xml server and straight ODBC connections. ...
1
vote
0answers
385 views

What's the Difference with these Knockout Viewmodel constructors?

When creating a viewmodel for Knockout, what's the difference here? I see these different implementations and I've tried a few and some don't work the same. //the most common example. function ...
1
vote
0answers
99 views

Performance increase by only attach onblur handler inside of onfocus handler?

Given a web page with input fields, does it have a performance difference whether or not you assign the onblur handler inside of the onfocus handler like so: var inputFields = ...
1
vote
0answers
370 views

JavaScript program design: to what degree should I separate logic and display?

Consider you wanting to implement a simple game of checkers. There would be a rectangular game board and the player would able to move the pieces around according to a particular set of rules. ...
1
vote
0answers
88 views

Why does JSF not tend to render specific value to constant in some tags

This question is about JSF concepts or architecture; probably I don't understand enough to be more specific. There are some ways to pass parameters to commandLink actionListener. But there are no ...
1
vote
0answers
37 views

Is there a way to handle shared javascript assets in Spring?

I'm familiar with MVC web frameworks and lately very familiar with Symfony2. I want to start learning Spring, and the first practical problem I would like to try to solve is handling the reuse of ...
1
vote
0answers
581 views

Managing Login Authentication/Webpage session: Can client side javascript/JQuery access either a session variable or json variable in html?

Short version: A variable is stored in a session variable req.session.userName and also in the json sent with res.render('/', {username: value}). How can I access either of those variables from inside ...
1
vote
0answers
201 views

Mutual Authentication in JSON or AJAX only?

AFAIK we must install the client-certificate into the users browser to connect with https-sites using server-certificates to have a mutual authentication. What about AJAX and JSON, can we connect to ...
1
vote
0answers
161 views

Using Singletons in JS with workers

I'm building a javascript application that does continuous drawing, but relies on asynchronous scripts in the background which also need to poll for events and write to "global variables". This got me ...
1
vote
0answers
52 views

Scale parts of image to fill bezier path with no wastage

I want to be able to take an image and stretch/contract each pixel row (or 5 rows for performance) to fit within a curved shape. I've been searching for this for the last few days and have turned up ...
1
vote
0answers
240 views

Binding in web frameworks - to frontend data or backend data?

AngularJS and other web frameworks provide data binding abilities (as in WPF). Is the UI bound to JavaScript variables on the frontend (web browser) or is it bound to the data in the server (via AJAX ...
1
vote
0answers
81 views

How do I manage a JavaScript library with TFS?

I know that I can share files between Visual Studio projects using linked files and assemblies using project references. Is there a good approach for JavaScripts? I'd rather not use linked files since ...
1
vote
0answers
158 views

Backbone and JavaScript

I have been programming in JavaScript for just a little over two years give or take, I am still in the intermediate part of the know-how spectrum. I have recently just discovered Backbone and I love ...
1
vote
0answers
283 views

how to integration dynamic web fields and forms

I'm trying to find a way to design backend that will be handling customized web forms creation on the fly. Once created those forms will be injected to part of the existing web pages. I've created ...
1
vote
0answers
99 views

Javascript library for Java source code reference

Could you suggest any JS lib, that will "recognize" all Java classes in specified text and create reference link to page with this class? (similar to Eclipse Ctrl+click) There are plenty of good JS ...
1
vote
0answers
75 views

reading parameters and files on browser, looking how to execute on server

I have a site done in Rails, which uses javascript to load files and generate forms for the user to input certain information. Those files and parameters are then to be used in a fortran code on the ...
0
votes
0answers
40 views

Embedding custom business logic using Javascript in Java application

We have an application where the front-end is completely rendered dynamically. The web page is stored as JSON in the database. A simple JSON to display input field with a label is as follows: { ...
0
votes
0answers
38 views

How can PhantomJS take a JavaScript file and use it to drive the WebKit?

I have read a lot of documents and wiki pages about PhantomJS but still don't understand, how can PhantomJS take the input JavaScript code to drive the WebKit? Take the code from PhantomJS Quick ...
0
votes
0answers
29 views

Event dispatcher and state

I'm using an event emitter similar to Node's, with the following pseudo code: event.on('onFuncBegin',(e)=>); event.on('onFuncEnd',(e)=>); let myFunc=()=>{ ...
0
votes
0answers
37 views

Code structure for complex UI module with strongly bonded components

I'm trying to figure out a new approach in organizing my code structure. Let's say I have a single-page module which UI consists of: form with search filters, very interactive table (paginated, ...