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)

3
votes
0answers
154 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
52 views

How do I create a modal service with AngularJS?

I'm trying to make a service that's polymorphic based upon what mode is specified in the URL. If the char param in the route is set to 'p', I want to use a PresentMode service. If the char param is ...
2
votes
0answers
87 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
90 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
43 views

Unit Testing a stateful framework such as Phaser?

I'm currently writing a game in TypeScript and the Phaser framework. Phaser describes itself as an HTML5 game framework that tries as little as possible to restrict the structure of your code. This ...
1
vote
0answers
74 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
104 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
70 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
117 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
108 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
139 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
57 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
117 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
146 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
181 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
40 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
187 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
86 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
14 views

jQuery event binding management

Given the following elements: <div class="container"> <span class="some-class">content</span> ..n span repetitions.. </div> Given the following .on() ...
0
votes
0answers
19 views

Is having a parent controller to manage a set of tabbed sections an anti-pattern for an angular application?

A lot of times, I have long forms that I divide into multiple tabbed sections. Each section is managed by it's own controller and there is a parent controller that manages the whole view. I use ...
0
votes
0answers
15 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 ...
0
votes
0answers
23 views

Incorporating web designer's into a rails app

I have a designer who has great knowledge of HTML, CSS and JavaScript (Not jQuery or AJAX though). He gives me his designs in those files and I have to incorporate it into my apps. The site is not ...
0
votes
0answers
85 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
65 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
59 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
69 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
63 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
27 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
65 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
123 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
442 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
137 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
78 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
54 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
113 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
99 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
260 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
89 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
213 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
368 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
231 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
178 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
208 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
387 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 ...