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)

-5
votes
0answers
36 views

Will Internet Explorer 11 become the bottleneck of web technologies? [on hold]

Internet Explorer has been the browser lacking the latest features of CSS and JavaScrip for a long time. If you need to support IE, you cannot use the latest CSS/JS technologies (at least not easily). ...
-2
votes
0answers
19 views

Use of cordova plugin RF ID scanner

How can i use RF-id scanner plugin to read the data? $scope.callScan = function() { try { rfidscanner.radar(winScan, failScan); } catch(err) { alert("Error: " + ...
-5
votes
0answers
57 views

Is there great practical collection of rules for Front End? [on hold]

I'm going to create some kind of "standards" of Front End development (from simple "PSD to HTML" tasks to entire single page applications). It should be overall and legible, now I have some basic ...
0
votes
2answers
104 views

Including a GPL-licensed library through a CDN

I'm planning to use Flickity in my MIT-licensed open-source JavaScript project. The license for open-source usage is GPL. Can I link the file via a CDN into my project, or is this considered a "...
0
votes
0answers
25 views

Emscripten - passing command line arguments

I have a C program "translated" (dont know what word is appropiate) to Javascript, so I can use it in node.js. C program consists of main that accepts command line parameters. I understand that I need ...
0
votes
2answers
301 views

Put code on client (JS) or server (C#)

In an ASP.NET app, I've got to decide whether to put a complex piece of code on either the client in JS or on the server in C#. I've considered performance (if on server, it would be a small ...
1
vote
1answer
57 views

Memory usage of JavaScript string type with identical values

JavaScript string type is immutable, but does it mean identical strings will share memory? Say two strings are created in complete different places, will a modern JavaScript engine be smart enough to ...
2
votes
1answer
159 views

JavaScript - Client-side separation of Model and ViewModel?

I am developing web apps using the Model-View-ViewModel approach with Knockout.js. After reading on the original introduction of MVVM by John Gossman, I realized that my ViewModel always contains ALL ...
0
votes
0answers
18 views

Is it a good idea to store long delimited strings in DOM?

Is it a good idea to keep long strings like base:Regular 1,optional:my_optional_plan,optional:optional_plan_2 in the DOM that could be used later when needed or should the data be brought only ...
1
vote
1answer
40 views

How is approval done in cors via preflight request?

As far as I have known in CORS, browser sends preflight with OPTIONS request to the server to gain approval for the real subsequent GET/POST request. Now, HTTP is sessionless. Is the custom header THE ...
4
votes
1answer
451 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" ...
130
votes
6answers
23k views

How much should I be using 'let' vs 'const' in ES6?

I've been writing a lot of ES6 code for io.js recently. There isn't much code in the wild to learn from, so I feel like I'm defining my own conventions as I go. My question is about when to use const ...
42
votes
5answers
4k views

How to avoid typical “dynamic language mistakes”?

I've recently poured a couple of hours into JavaScript because I wanted to benefit from the massive userbase. Doing that I have noticed a pattern that most people attribute to dynamic languages. You ...
5
votes
4answers
3k views

How does Chrome V8 work? And why was JavaScript not JIT-Compiled in the first place?

I have been researching Interpreters/Compilers, then I stumbled across JIT-Compilation - specifically Google Chrome's V8 Javascript Engine. My questions are - How can it be faster than standard ...
103
votes
5answers
17k views

Is there any reason to use the “var” keyword in ES6?

Babel's guide to ES6 says: let is the new var. Apparently the only difference is that var gets scoped to the current function, while let gets scoped to the current block. There are some good ...
5
votes
1answer
8k views

Why sending a file is so difficult using angular? [closed]

I have to send a file (very large file) to a server. I'm studying what options I have and how to do it. I'm using angular + express + nodejs. If I use a simple form, I could catch the file on the ...
0
votes
0answers
38 views

Is it worth working on Google Closure now

I'm evaluating to whether to include this in my workflows. My workflow for JavaScript tools include and they offer me following. WebStorm (Excellent Code hinting, JSDocs comments, Refactoring etc.) ...
1
vote
1answer
96 views

Why does array.push() sometimes take more time in Javascript with Google Chrome

A while ago I've made a simple script in Javascript that tested how much time it takes to add elements to arrays. I've used 3 different methods: array.push(), array[array.length] and array[x] where x ...
0
votes
0answers
45 views

Strategy To Upgrade Frontend Javascript Code - Typescript or New Framework?

Here is my scenario. I would like advice on which path to follow, along with good reasons as to why. It would even be better if you could give an example based on experience of a similar decision but ...
0
votes
0answers
47 views

How to handle ID's with resources that can be combined?

Early on in my app, there were simple Customer objects with an int id. In my database, some customers are split into multiple accounts for organization purposes. For ex. "CustomerA" (Main account) (ID:...
1
vote
1answer
42 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 ...
7
votes
6answers
685 views

How are large JavaScript applications supposed to be structured?

I've recently been shown some JavaScript plugins written for OBIEE Mobile App Developer, as well as some custom libraries for various projects. Coming from an OOP background, I am a little confused ...
0
votes
0answers
23 views

Javascript : Handling multiple API Requests (Adobe Analytics)

I have a requirement to build a enterprise dashboard where data from various digital assests (around 20 primary websites, mobile apps) of our company can be presented. This data is already stored in ...
1
vote
3answers
131 views

Unlike C++, why does uncaught exception in JavaScript not terminate the script?

As someone used to C++ and new to JavaScript, I find this behavior odd. Whether a program runs directly on the platform like C++ ones, or it runs at a higher (or deeper?) level like JavaScript ones, ...
0
votes
1answer
55 views

Recommended strategy for changing javascript UI table library?

tl;dr - On an existing angularjs grid library, am moving to another. Is it better to wipe out as much code as possible and in a sense code from scratch to the same featureset, or work around what's ...
3
votes
3answers
345 views

Is it faster to make a dedicated variable instead of calling deeply nested object several times?

In a JavaScript app, suppose I have a nested object like this: var myObject = { someProp: { someOtherProp: { anotherOne: { yetAnother: { ...
-1
votes
0answers
23 views

Dependency Injection framework for TypeScript and JavaScript (es5) [migrated]

I've been looking for a DI framework that works well across TypeScript and pure JavaScript (es5). I've come across some implementations, such as Inversify and Angular's 2 DI. However, Inversify seems ...
0
votes
0answers
41 views

How to avoid multiple long polling request from chat app

I am building a real time chat app for eCommerce app customer-seller. As I am using long polling Technic. I need to understand how can I optimize multiple long polling request. For eg. I am a ...
1
vote
1answer
63 views

google maps API key for clients

Google API key is now required for new websites even for a single map embed. How are you going to handle this? I guess the correct way should be to ask a client to create his google API key and send ...
5
votes
3answers
961 views

Why is JSX good, when JSP scriptlets are bad?

React.js provides JSX as an XHTML-like syntax for constructing a tree of components and elements. JSX compiles to Javascript, and instead of providing loops or conditionals in JSX proper, you use ...
4
votes
1answer
674 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 ...
0
votes
2answers
119 views

How to 'read' arrow functions in ES6?

I've been trying to learn some of the new features of ES6, and while most of it makes sense, I'm having trouble grasping the arrow function. I'm not asking so much why it exists as I am how to read it....
-1
votes
0answers
59 views

Using ajax to make pages seem more responsive as an alternative to Angular?

AngularJS, Ember and React are all the rage these days. I get their appeal and as much as I'd like to learn them I just don't have the time. I'm writing an unsophisticated application that can be ...
9
votes
5answers
5k views

XSLT equivalent for JSON

I was interested in finding (or if necessary developing) an XSLT equivalent for JSON. As I have not found any, I was considering the possible query language to use for matching JSON paths so as to ...
0
votes
1answer
78 views

Understanding streams

I have started learning streaming APIs and I found one of the good documentations here. There was a comparison given by author to demonstrate the effectiveness of the streams. var http = require('...
4
votes
4answers
3k views

To MVC or not MVC, that is the question

Originally, I started off doing jQuery plugins, then moved onto Backbone.js applications, then been experimenting with MicroJS MVC modules, but these days I'm even wondering if there is any need for ...
1
vote
1answer
115 views

Monads in JavaScript

A monad is an object that has: A transformation that takes a type and produces a new type. In C# we call such a transformation a "generic type". We have a generic type M<T>, we have a ...
0
votes
1answer
81 views

One time use token Mobile / Desktop linking. How to?

I want to know if there's a way or known way to implement this: Lets say I have: a C# WinForms program a Javascript Mobile Application (Android / iOS) What I want to do is: for my C# ...
5
votes
4answers
588 views

Minimal programmer's definition of a monad

I am trying to formulate a definition of a monad without needing mathematical terms or Haskell to understand. Can a monad be thought of as a function that accepts a value and wraps it such that it ...
0
votes
1answer
31 views

Why can't an ES2015 WeakMap have primitive keys?

There are six primitive data types in JavaScript: Boolean, Number, String, Symbol, undefined, null A WeakMap can't have primitive data types as keys. And a WeakSet can't have primitive values. Why ...
2
votes
3answers
214 views

Mapping different XML and CSV feeds

Not sure if this is the right venue to be asking this but here goes. A little background. I'm trying to build an ecommerce app that would allow sellers from other venues--like, amazon and newegg--to ...
3
votes
1answer
226 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 ...
5
votes
2answers
168 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) ...
-3
votes
0answers
27 views

Unknown javascript function [migrated]

I have the function function bind(method, context) { var args = Array.prototype.slice.call(arguments, 2); return function() { var a = args.concat(Array.prototype.slice.call(arguments,...
2
votes
3answers
174 views

Unit of Work AngularJS

I am writing an application in Angular JS (1.5), and I need to be able to track a model for changes (updates/deletes/additions). For example, I have an ng-model that holds an array of user pets. This ...
1
vote
0answers
77 views

How should I decide switching to vue.js from angular or not as a team member?

Currently I am working on a project that the view depends on data input by user a lot, so AngularJS was used in the project. This was the usual choice of our small team. (so small it is still below 10 ...
0
votes
0answers
21 views

Handling Multiple External Web Beacons on a site

I've been searching for this info but could not quite find an answer that would work for this. I hope it's clear enough... First, let me setup the scene: We currently develop and maintain a mid to ...
3
votes
4answers
276 views

Easy way to make old javascript files conform to new quoting standard?

We've just started putting linting in place at my workplace, and a lot of the devs didn't realize our standards called for double-quotes everywhere. About 50% of the codebase uses single-quotes, so it'...
7
votes
5answers
8k views

Is it better to put the JS code on the html file or in an external file?

If I'm designing a one page website, is it better to create external file for my JS code, or just put it in the html code? Is putting it on the page faster to load? Can I change the permissions to ...
3
votes
1answer
435 views

is this a valid javascript design pattern when many instances are required?

I have some code that I'm refactoring, right now its just a list of functions, primarily jQuery. The code is a form builder. The user adds sections, questions etc using jqueryUI drag/drop/sort. They ...