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)

-1
votes
0answers
17 views

Interactive “notebook” interface for browser javscript

IPython has spun off their web notebook interface to be language-independent, and there's a nodejs backend available for it. But seeing as every web browser has javascript built in, it seems kind of ...
-1
votes
0answers
32 views

Javascript coding convention: capitalization with requirejs [on hold]

We are having an argument, where it has been proposed (among other things) to change requirejs statements like this: define(['thing', 'xyzzyView', 'backbone'], function(thing, XyzzyView, backbone) { ...
-5
votes
0answers
29 views

Using angularjs in blogger [on hold]

How about using the angularjs in blogging? Would that be causing any conflicts with the blogger platform? Is there a smart way to do it? Asking for real responses.
30
votes
12answers
5k views

Why the recent shift to removing/omitting semicolons from Javascript?

It seems to be fashionable recently to omit semicolons from Javascript. There was a blog post a few years ago emphasising that in Javascript, semicolons are optional and the gist of the post seemed to ...
2
votes
2answers
168 views

Should the ternary operator be used outside of assignment statements? [duplicate]

Edit This isn't a question of whether or not the ternary operator is harmful. It's about whether or not there's a consensus about whether or not it should be used outside of assignment statements. ...
-2
votes
0answers
20 views

Which framework (if any) should I use with React/Flux? [on hold]

So I am coming from Angular. I have built a couple React components, but I have never used the Flux architecture. I am hoping to figure out if I am going about this correctly before I write any code. ...
-6
votes
0answers
33 views

What does it mean by state information? [on hold]

I'm doing some research, I've read about state information and I'm not all that sure what it is. What is used to maintain it? Cookies, query strings, local variables, and databases? I can understand ...
6
votes
2answers
601 views

What is the best way to format complex SQL queries in Node?

I am using node-mysql to query a MySQL database via Express and Node. My queries are getting fairly complex and I want to format them across multiple lines. However, the only way I could accomplish ...
1
vote
1answer
178 views

html/css/javascript for game ui's

I've been looking into game ui's recently. My conclusion is that html/css/javascript would be the perfect solution IF it was wrapped up in a nice C++ library that allowed for easy integration into ...
-4
votes
0answers
46 views

Why is console.log() not working inside module.exports? [on hold]

I am trying to export the functions so that they are executed when my /submissions endpoint is hit. In app.js I have app.use('/submissions', submissionbot) Why can I not use console.log from within ...
2
votes
1answer
52 views

Is web sockets the best solution for my problem?

I have created a Slackbot that integrates with Submittable.com. For example, I can trigger a response that displays all current submissions in Slack. I now need my Slackbot to post in Slack whenever ...
0
votes
1answer
58 views

Best Practices: URL Path Parameters [on hold]

What's the current best practice around path parameters in URLs? For instance /artist/name A long time ago I might have made artist.html and then passed in a query parameter /artist.html?name=name ...
0
votes
1answer
55 views

Can 32/64 bit version of Dart SDK have any effect on produced javascript code?

I just started collaborating remotely on a project. Project manager explicitly asked me to download Dart SDK 32bit version. Since I have 64bit machine I asked why to find out more about it. I was told ...
1
vote
1answer
69 views

Does requestAnimationFrame() really align with monitor refreshes?

Take this code: requestAnimationFrame(function (timestamp) { console.log('one', timestamp); }); requestAnimationFrame(function (timestamp) { console.log('two', timestamp); }); // logs: // ...
0
votes
0answers
56 views

Shared data in functional programming

I have been working on a project in JavaScript which requires a data structure (read only), to be shared between two functions. var mySharedData = ['hours', 'minutes', 'seconds']; Now I have two ...
0
votes
1answer
36 views

How to delete active sessions and enable different users to log out from the system without any clashes [on hold]

Currently been working on some few small scale web applications but still did not understand the logic behind on how to clear off a target session? For example, imagine a small web application that ...
2
votes
1answer
127 views

Managing Massive Updates with Resource Access

I have a number of data servers that are pushing data to a main server as in this kind of architecture: These data points (points for short) are updated randomly from each server. On the server, ...
-1
votes
0answers
25 views

Passing data from a parent object to one of it's nested child objects when using a compose function [on hold]

I've been applying functional programming to my JS code with a heavy emphasis on using underscore's compose along with a simple map function which looks like this: // map allows me to compose better ...
70
votes
28answers
9k views

How important is graceful degradation of JavaScript?

Should web developers continue to spend effort progressively enhancing our web applications with JavaScript, ensuring that features gracefully degrade, thereby ensuring accessibility? Or should we ...
0
votes
0answers
39 views

Securing HTML/JavaScript only web app / JAX-RS Backend [closed]

I am prototyping a small web app where the frontend will be a pure HTML+JavaScript+JQuery which consumes services from a JAX-RS backend. The application has started to have a shape now but I find ...
7
votes
2answers
158 views

Cross-language Test-Driven Development

The short question: How do you follow Test-Driven Development on a project that spans multiple languages? Specifically, I'm writing a web application that uses JavaScript and PHP, and I want to ...
-3
votes
0answers
35 views

I am misunderstanding a jQuery array [migrated]

This code doesn't work var next = $("#orders").find(".next"); if (next.length == 1) { var address = $(next[0]).find(".directionsAddress"); var destination ...
15
votes
7answers
6k views

Would Python be too slow for client-side use in Browsers?

I've heard the statement that Python would be too slow to be of any use in browsers. I reckon Javascript is only superior in this aspect because of companies like Google who need it fast (and made it ...
0
votes
0answers
15 views

Using Simile widget timeplot to overlay events on discrete data [migrated]

I was given the task of finding a way to graph my company's manufacturing data from each batch of material (specifically density) with an overlay of process changes in some sort of timeline format. It ...
-1
votes
2answers
122 views

What is an anonymous function? [closed]

I am new in programming and it's kind of difficult for me to understand what the context of an anonymous function is. this is my code: toevoegButton.addEventListener('click', function() { ...
0
votes
0answers
3 views

Div heights not the same after setting equal heights with javascript [migrated]

I have two divs which I would like to be of equal length. Div1 has text in it which determines its height. Div2 is a scroll box which should have apparent height the same as div1. The following code ...
0
votes
4answers
3k views

How to improve my loop logic in programming? [closed]

I know how to do simple loops but I don't know what's going on when many loops are working together. For example: for (var i=0; i <= 9; i++){ document.write(i); for (var m=0; m <= 9; ...
0
votes
0answers
27 views

Authenticate Joomla User from an External App based on Node.js, Javascript and mongoDB

I have an iOS App which currently pulls in all the data from the MongoDB using a Node JS server. Currently my API / my node server handles all the data manipulation the iOS app/Swift only displays the ...
4
votes
3answers
283 views

Functions whose parameters are implicitly supplied

Callback functions are able to accept some parameters, but they are not explicitly declared when calling the function. How does this actually work? What is going on that allows us to pass a function ...
4
votes
1answer
452 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
1answer
125 views

Node.js callbacks and this - how it should be solved?

Every JavaScript programmer is familiar with this "problem" (it can be considered as a feature, depending on various conditions) - this is lately binded: let foo = { bar(){return this;} }; let ...
0
votes
0answers
26 views

Is it better to store integer data or array references in a javascript visualization?

Say I have a tree that I'd like to visualize with d3. Nodes have various attributes produced by the d3 library, attributes like an index and position variables. Now, I could add more attributes to ...
0
votes
1answer
116 views

Measure and locate areas of similar value in an image

I saw this picture online and wanted to see if I could create an algorithm to give ordinary images an effect like this: http://justinlivi.net/wp-content/uploads/2011/01/Living_In_Digital.jpg My idea ...
0
votes
1answer
289 views

JSP in Javascript file or multiple AJAX requests

I've been thinking about how I want to load my data for some checkboxes in an AngularJS app. I'm generating multiple checkboxes based on 2 JSON objects that are currenty hard-coded in the a Javascript ...
0
votes
1answer
127 views

Why does a lot of Angular source code avoid enclosing the contents of a file in a closure?

I am assuming because it is a standard practice in the Angular world that, any sort of module system has to be wrapped as an Angular module and angular should be the only global variable used which ...
0
votes
1answer
65 views

Implementing the State Pattern with Object.setPrototypeOf()

Take a look at this implementation of the state pattern in JavaScript: var ON = { switch: function() { Object.setPrototypeOf(this, OFF); this.state = "OFF"; } } var OFF = { ...
2
votes
1answer
90 views

Best-matching comparative values using all items in array

I have two arrays of objects (items) in the exact same format. Each item represents a wager, and each array represents one of two outcomes for that wager (ex: Team A vs Team B). Both arrays look ...
4
votes
1answer
137 views

Importing plain javascript libraries in an AngularJs application

I am working on an AngularJs project which is getting bigger very fast. Currently I need to store some user data, so I was using $localStorage for Angular. But I had a problem, as the application is ...
6
votes
2answers
2k views

What is an Activation object in JavaScript?

In a given execution context, the Variable object is the Activation object of that execution context. From my research online, I am able to find the previous sentence rephrased in different ways ...
0
votes
1answer
76 views

Looking for a way to interpolate a base URL that won't conflict with Underscore template code

At my workplace, we have dev and production environments, and a separate server that serves static files for each environment. In my code, I make references to the URL of this static file server. ...
0
votes
1answer
50 views

How to filter RSS feed results, according to a DOM element in its page content?

I've a "RSS feed", want to filter its results according to a DOM element in its content! So, this is the mission I'm looking forward to do: Monitor a "RSS feed" continuously. If new RSS elements ...
1
vote
0answers
225 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. ...
74
votes
23answers
6k views

How do developers find the time to stay on top of latest technologies? [closed]

I was a freelance web developer until circa 2004 when I started going down the management route but have decided to try to get back into development again (specifically JavaScript and HTML5 web/mobile ...
0
votes
0answers
43 views

Is there an algorithm to avoid getting in hundreds of datapoints from API to represent a bar graph?

I am showing a graph on HTML5 canvas using the flot charting library for a between a start date and an end date. It's fine as long as the period is less than a year or so but if the user selects a big ...
2
votes
1answer
94 views

Reuse already fetched data for request

I have action that fetches user model from db to check access. Then I have method that in some cases requires same model. function checkAccess(req, res, next) { var data = ...
1
vote
2answers
789 views

Why a hashtable? Why not just a non-hashed associative array?

I've been learning about using a hashtable to efficiently check for items in a list without looping through the whole thing, but there's one thing that I don't get: Why hashed keys? It seems like: ...
28
votes
1answer
856 views

What is the term for an anonymous JavaScript function that's called immediately?

I'm writing a JavaScript style-guide for my team, so that we can organise and contribute our documents easier. But I've hit a small bump which is where my question applies... What am I supposed to ...
0
votes
0answers
72 views

When and when not to use OOP in Javascript? [duplicate]

This post suggests that javascript code should be written in object oriented design. He gives a trivial example of making some ajax call and alerting the response. From the world I come from (c#) he's ...
0
votes
1answer
68 views

How to avoid circular patterns in Node?

I'm new to Node and JavaScript (well, asynchronous programming in general) and I noticed when I was working on a project that the following code is a circular pattern and that these are bad practice ...
4
votes
1answer
241 views

When to use Prototypes & the correct usage of Prototypes ( Javascript )

I have been programming in Javascript for a while and I am quite comfortable with it. And I know the basic concept of prototypes and I have also used them a few times. But one thing I can't figure out ...