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)

2
votes
1answer
524 views

How can I keep Web services requests in a DAO layer without tying the code to the DOM?

I'm working on a single page application on the node-webkit desktop app platform, which means 99.9% of all of the logic is written in JavaScript. Since this is a reboot of a project we're working on, ...
2
votes
1answer
202 views

Local Updates in Persistent/Immutable Data Structures

I'm getting into ReactJS and am intrigued but also confused about persistent data structures. I love the idea, but I'm not sure how to take my MV*, Mutable, Observable Bindings experience in designing ...
3
votes
0answers
131 views

JavaScript Combination Inheritance Pattern

In the chapter of Professional JavaScript for Web Developers on OOP, Nicholas Zachas describes a JavaScript inheritance pattern which he refers to as combination inheritance. The basic idea is that ...
2
votes
0answers
73 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
88 views

Set of specific values implementation vs. using some sort of generic set with advanced checks

I am working on a set implementation in JavaScript currently. This should kind of simulate generics as known from Java or C#. I need a mutable version of that (allows for adding/removing set values) ...
1
vote
0answers
72 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 ...
1
vote
0answers
96 views

Distributed vs Centralised configuration

We're building an app based on Flux/React - and we're trying to establish a scalable pattern for configuring routes and registering dependencies. The two approaches we have can be broadly categorised ...
1
vote
0answers
49 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" ...
1
vote
0answers
109 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 ...
1
vote
0answers
92 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 ...
1
vote
0answers
35 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 ...
1
vote
0answers
42 views

Range searching with WebGL

Is it possible to use somehow WebGL to fasten up 1d range searching? I need to find overlapping date intervals, and I thought that 3d games usually have a very similar problem by rendering frames... ...
1
vote
0answers
134 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 ...
1
vote
0answers
56 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
111 views

Writing a PHP wrapper for Javascript to safely access REST API

I am looking for signposting help to secure my API keys when accessing a database over REST API from Javascript on a webpage. I have read that in order to secure the API key I need to create a wrapper ...
1
vote
0answers
135 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 ...
1
vote
0answers
178 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 ...
1
vote
0answers
223 views

How many Angular Controllers and/or Directives is too many?

I'm building a large, editable data table with angular, and I'm trying to figure out what the best practice is. The table will be a couple of hundred rows, with a couple of dozen columns, so upwards ...
1
vote
0answers
175 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
85 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
1k views

How should I structure modules in an Angular.js application?

I am fairly new to Angular.js, and one that confuses me is how to best use modules in an application. It seems to me that modules can contain any of the other common constructs in AngularJS ...
0
votes
0answers
27 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 ...
0
votes
0answers
53 views

Naming self or this something else, a good idea?

I'm finding that my code becomes more readable when I make a local reference to this/self, and/or call it something that makes sense in the context. "self" or "this" doesn't really indicate what kind ...
0
votes
0answers
55 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 ...
0
votes
0answers
53 views

Should there only be one controller per page within a JavaScript-based MVC architecture?

Let's say that I create a page in my marketplace web application where buyers can see a catalog of all products offered by some or all sellers or sellers can see just their own products in a preview ...
0
votes
0answers
65 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 ...
0
votes
0answers
43 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 ...
0
votes
0answers
173 views

What is the use of the prefix “for(;;);” in an Ajax response

After using the chrome debugger to inspect the ajax requests of Facebook (for curiosity), I noticed that the response is in JSON, however it is always prefixed with for(;;); In example, if the JSON ...
0
votes
0answers
59 views

Token based autorization for a web game

I am lead developer for a multiplayer game in a small startup company. I would like to present here my solution for token based authentication and hear your opinions about possible weak spots. I am ...
0
votes
0answers
26 views

What's the Content-Security-Policy-friendly way to hand data from the server to the browser on page load?

When developing for the web, I often find myself wanting to pass a few variables from the server scripts to my javascript - data pulled from a database, and set differently on different pages running ...
0
votes
0answers
63 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 ...
0
votes
0answers
106 views

Javascript and SQL Lite (multi browser offline SQL/database query)

I'm in the elections division of my county and am trying to simplify a voter lookup method for our poll judges during election time. Currently we are using a clunky heavy application that the judges ...
0
votes
0answers
427 views

Efficient development process for Golang (or any backend) and JavaScript?

I am developing a web application. The frontend is a mix between JavaScript and server-side generated html. The backend is written in Golang. Might not be very important, but if somebody made a ...
0
votes
0answers
108 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 ...
0
votes
0answers
69 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 ...
0
votes
0answers
123 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 ...
0
votes
0answers
53 views

Using JavaScript to find the correct offset in bundled files

I am currently making multiple parsers using PEGjs and have implemented my own partial preprocessor which using a RegExp finds and replaces '#include' directives with the desired files, resulting in a ...
0
votes
0answers
105 views

Best practices in creating JavaScript styling API's: Balancing CSS and JavaScript

I have written a number of components for Durandal--DatePicker Widget, Tabs Widget, Radio Widget, etc. I'm having a little conceptual difficulty in how best to balance a styling API with CSS. For ...
0
votes
0answers
34 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 ...
0
votes
0answers
92 views

Keeping Backbone model in sync with editable view

I'm making a web form for editing some objects. I'll call these objects Foos. I have a Backbone model that represents Foos. I have a Backbone view that renders an editor form, filling in fields ...
0
votes
0answers
257 views

Javascript design pattern with jQuery Widget factory

I am using the jQuery widget framework for creating some graphical elements on a webpage, and I have a conseptual question about the overall structure of the code. I have 3 classes A, B and C which ...
0
votes
0answers
86 views

What is special about JDBC that makes it unlikeable for JavaScript

Quoting from Selenium Architecture A natural implementation would have been to provide a database connection to the underlying data store, using something like JDBC. Eventually, we settled on ...
0
votes
0answers
202 views

Should you implement a repository pattern with an MVVM javascript framework?

When coding a MVVM pattern I use Dependency Injection (DI) and try and code against interfaces. One of the common patterns is a Repository pattern, so I can swap my data storage provider. If I'm ...
0
votes
0answers
362 views

AngularJS: directives and controllers: resolve, loading, reloading

I have a philosophy question about AngularJS and directives but correct implementation of the next problem solves it. So, I need an AngularJS directive, It loads some data via several (not one!) ...
0
votes
0answers
222 views

Numerous Sync/Async calls to webservice from hybrid app

I have a requirement where I have to make numerous calls to webservice to update the local database. Since I have to support lower-end Android phones also, I'm not yet sure as to how this would be ...
0
votes
0answers
209 views

Cost Benefit Analysis of choice of javascript framework for excel-like web app

I am engaged by a telco company sales team to develop a web application to replace their current workflow. Their current workflow consists of many spreadsheets containing product, pricing, and sales ...
0
votes
0answers
169 views

Javascript: initiating file download and routing file off via POST

Every so often (seems about once a year) I get a chance to play with JS. While not proficient, I'm comfortable enough to get the job done if I have some good references. At this point, I feel like ...
0
votes
0answers
202 views

How to add document directory path in javascript file in iOS -MetaIO SDK

I am working on a project using MetaIO SDK (AREL). It works fine with all the files in the package (ipa), but I'm trying to download an animation automatically using a web service. It will be ...
0
votes
0answers
373 views

Best option to send image from javascript client to SQL server

From a client (browser), using javascript I want to send an image to sql server ( and store with user profile) (sql server), along with other data such as user id or name. Which option is better? ...
0
votes
0answers
68 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 ...