Questions tagged [javascript]

JavaScript (not to be confused with Java) is a high-level, dynamic, multi-paradigm, weakly-typed language used for both client-side and server-side scripting. Use this tag for questions regarding common implementations of ECMAScript, JavaScript, JScript, etc. JS does not typically refer to its ECMA-cousin, ActionScript.

138 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
315 views

Versioning Practices for Javascript SPA Application

I've developed an SPA using AureliaJS. We use team Foundation server to service our source control, but that doesn't really help with good versioning practices. For instance, with our WPF applications,...
1
vote
0answers
68 views

designing better and crisp server.js (the file which is called to start node application 'e.g. node server.js')

While creating server.js file we need to provide routes information as var Login = require('./routes/login.js'); app.use('/login', Login); Now, suppose the node project is a REST services project. ...
1
vote
0answers
268 views

SystemJS Transpiler - where would it be used

I'm creating a project which uses SystemJS/JSPM. I'm also using TypeScript. Now TypeScript has the option of compiling JS using SystemJS Modules - which I'm doing and all is good. I've created TS ...
1
vote
0answers
41 views

Best method to allow user to choose multiple things from my DB?

So I have a "Bars" table in my database and a "Add a Bar" form which allows a bar owner or manager to add his/her business listing to my website database. I also have a "Beers" table in my database ...
1
vote
0answers
378 views

Conceptual similarity between Ruby's and JavaScript's inheritance models

To clear some potential confusion, let me start with the following statements As far as I understand, inheritance is mostly about dynamic dispatch. I understand how virtual pointer table based ...
1
vote
0answers
194 views

Find longest match from a set of possibles, given a string

I’m implementing glossary/dictionary in Javascript. It is populated with a set of terms and their definitions internally, then gets handed jQuery elements and searches the HTML, replacing any of the ...
1
vote
0answers
75 views

Pointers on porting a c++ workflow domain specific language to javascript

I am writing a game in c++ with the v8 javascript engine embedded in it. I have a c++ workflow system I use to tell things how to do specific things. It's nice and I like it, but I need it to work ...
1
vote
0answers
75 views

How do I write an API that makes use of many smaller APIs?

I have a solid set of classes that do the following build tables from data and templates advanced form serialization build forms from data and templates launch overlays with forms/wizards short poll ...
1
vote
0answers
56 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
2k 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
2answers
743 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
84 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
131 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
406 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. _([{o:{a:1}},{o:{a:43}},{o:{a:234}},{o:{a:23}}]).pluck("...
1
vote
0answers
40 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
262 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
1k 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
105 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
46 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
576 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
491 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
57 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
559 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
1answer
1k 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 ...
1
vote
0answers
132 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
474 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
396 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
139 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
80 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 ...
1
vote
1answer
250 views

Why bother with server-side form submissions in a SPA?

I am all in favour of progressive enhancement and using server-side rendering when fetching a URL. The age-old discussion gives several advantages, such as improved load time, SEO crawling and ...
1
vote
1answer
2k views

Are there any benefits to removing unused script files in a web site/project?

VS Web sites/projects come loaded with several .js files, most of which I don't use (e.g., I use a CDN for newer versions of jQuery and jQuery-UI). I know it's safe to remove these unneeded .js files ...
0
votes
0answers
14 views

Service worker / caching a whole API in a Flask app?

I'm building a small scale app based on the Flask micro framework. In it, I have a service worker that caches the basic shell of my app (HTML, CSS and JS). However, I have dynamic content that is ...
0
votes
1answer
108 views

How to avoid code duplication caused by javascript dict access?

I have two functions that group a list of dicts according to the value of a certain key. Here's how my array looks: const sections = [ { file_id: '1', heading_level: 4, readme_file_name:...
0
votes
1answer
51 views

Potential Solutions to loading Javascript classes unknown at run time

I'm looking for some advice or potential options for loading javascript files in real time long after the DOM has fully loaded. Those javascript files need to be sent over a WebSocket connection, and ...
0
votes
1answer
73 views

How to design a system that can operate and replay its functions call stack?

I am writing a processor for the Citation Style Language (CSL) in JavaScript. Before I explain what my problem is, I must give some context first: CSL is an XML specification for describing how to ...
0
votes
0answers
60 views

Handling user permissions in front-end

I'm building an API that will be used by the front-end in React and I'm not quite sure how I should send the permissions of each user based on their roles. Some fields can only be edited in some ...
0
votes
0answers
65 views

Should modules strive to export only one thing?

Ideally, functions should do one thing well, and only one thing. Does the same thing apply to what a module should export? Of course, modules aren't always the same thing as functions, but they often ...
0
votes
0answers
61 views

Why does Babel convert async/await to generator functions rather than promises?

It's a bit of a moot point now that async/await is supported by all major, modern JavaScript engines, but I've always wondered why Babel converts async functions to generator functions rather than to ...
0
votes
0answers
28 views

Why does Vue.js rename / move all the internal data elements?

I'm following the code from Vue.js in Action, Chapter 3. (much deleted for brevity...) var webstore = new Vue({ el: '#app', data: { sitename: "Vue.js Pet Depot", showProduct: true, ...
0
votes
0answers
59 views

Allowing a user on one page to be able to cause an event on another

I would like to allow a set of users to be able to submit a form on one page, and then it would cause an event to trigger on another page. For example: Submit Page: Includes the form, the user ...
0
votes
0answers
36 views

Messaging engine architecture with front-end and ORM layer (spring)

I'm looking to push my first QuickFixJ messaging engine into production, and I would like to know the best way to do so. Bear with me. The gist of the responsibilities is as follows: Through ...
0
votes
0answers
33 views

Extending prototype

I am currently refactoring a project where I come across the following kind of code multiple times: propertyFunction: function (feature) { doSomethingOnyWithFeature(feature); ... } Methods, that ...
0
votes
0answers
58 views

Two Web clients and Java server (HTTP and Websockets)

I have 3 software components of a Web Application: 1. JS-client application 1 (JSApp1) 2. Java Spring (REST and Websockets) server app (SRV) 3. JS-client application 2 (JSApp2) My current task is to ...
0
votes
0answers
23 views

How can I manage the state of my application using a dedicated object instead of what React offers?

Most of the react application I've seen are organized with components that, in my opinion, do too much. They may follow this pattern: class MyComponent extends Component { constructor() { ...
0
votes
1answer
56 views

Cross-domain data binding

I've been developing several front-end web-applications recently that bind against a database using a RESTful CRUD api. I've noticed a massive amount of boilerplate code going into defining the API. ...
0
votes
0answers
178 views

Event loop task and micro tasks order execution

I m actually studying different part of the event loop in javascript and I'm stuck understanding the execution order of the tasks from the task queue and the different microtasks. For now, running ...
0
votes
0answers
27 views

Promise, Ecmascript and Whatwg event loop

I've recently learned that setTimeout is not part of Ecma 262 standard but takes part of WhatWG one. I have one misunderstanding concerning these two standards and I can't get how they converge. For ...
0
votes
0answers
57 views

Naming convention for string constants and string functions

I'm creating a react application, and I want to keep all my string constants in a single file like: export const STR_LOGIN = "Log in"; //h1 on a login page export const STR_USERNAME = "Username"; // ...
0
votes
0answers
106 views

Is giving sub reducers access to the full state a bad idea?

I've got a Redux app with a fairly flat state tree. All sub reducers handle one separate part of the state, and they are tied together with combineReducers. My problem is that in a few cases I need ...
0
votes
0answers
46 views

JS ecosystem - In which oder I should learn them?

I'm migrating from Java to JS and I would like to know what is the best way to do it in the field of JS ecosystem. After reading all the You Don't Know JS series by Kyle Simpson, I would like to ...