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.
3
votes
0answers
237 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
162 views
Is obtrusive javascript required to support a feature of angular.js?
I'll start by saying I'm just learning about Angular.js, and I was reading this article, which seems to advocate for obtrusive javascript as the right thing:
...
2
votes
0answers
103 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
95 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
105 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
77 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
115 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
96 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
135 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
168 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
38 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
169 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
61 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
131 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
183 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
199 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
43 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
203 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
88 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
37 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;
...
0
votes
0answers
24 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 ...
0
votes
0answers
25 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. ...
0
votes
0answers
71 views
Reason why client-side JavaScript does not allow access to POST/PUT/etc contents
Is there any theoretical reason why client-side JavaScript could not be spec'd to allow for direct access to POST or PUT contents without need for a server language to write it into client-side ...
0
votes
0answers
49 views
Login Tokens Remote DataServer for use in a Javascript/HTML-PHP environment
I've asked this question on stackoverflow, but i think this is a more appropriate place for it.
I'm creating an app for iOS, Android and the Web. I created a separate Restful Data Service that is ...
0
votes
0answers
66 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 ...
0
votes
0answers
31 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 = ...
0
votes
0answers
218 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.
...
0
votes
0answers
22 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 ...
0
votes
0answers
20 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
185 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
88 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
83 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
44 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
175 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
71 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
30 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
80 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
153 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
494 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
203 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
91 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
129 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
55 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
112 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
97 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
212 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
236 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
424 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
69 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 ...