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)

-4
votes
0answers
28 views

Meaning of LoopBack(Strongloop) licence [on hold]

I use LoopBack to build a software as Community Subscriber. Licence: https://strongloop.com/license/ Can I sell that software? Do I need to give the source code of my software away? Is anyone ...
4
votes
1answer
75 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 ...
-3
votes
0answers
38 views

How do I send an image to sponsored buyer? [on hold]

I've been working on a website for a bit and have some questions that I'm rather stuck on if anyone could point me in the right direction that'd be great. So the question I have is this, I have ...
0
votes
1answer
46 views

Is it possible to use on focus event on form..?

I tried to find when and on what onfocus works.. Can some one tell me is it possible to trigger event when some one is viewing current form ?? I know it works on input,dropdown and textarea.. but ...
-2
votes
0answers
28 views

Why JavaScript regex implementation doesn't have lookbehind [on hold]

Most regex implementations allow a lookbehind condition, so that such an expression: (?<=hello )world will match world only if it is preceded by hello. This functionality can prove useful at ...
0
votes
1answer
25 views

Connect different programming paradigms in a real app written in JavaScript [duplicate]

I am learning functional programming, working generally with JavaScript. Many things look promising, like immutable data and stateless flow. Now, I want to build quite a basic CRUD app as a pet ...
0
votes
0answers
28 views

Hot swapping files and metaprogramming with front-end JavaScript

I was inspired by a video on hotswapping JS files with React + Webpack for the web. I started trying it out with React + Backbone + RequireJS. Seems to work, as long as I stick to the stateless parts ...
2
votes
1answer
137 views

Is it a good idea to have separate UI components make their own webservice calls?

I have few UI components in an angularjs web-application. Each display data based upon same input. One shows stats which are calculated on the basis of a time period. Other shows a chart of daily ...
-1
votes
0answers
35 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
36 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
179 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
26 views

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

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
2answers
611 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
182 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
47 views

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

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
65 views

Best Practices: URL Path Parameters [closed]

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
71 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
57 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
40 views

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

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 [closed]

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 ...
71
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
40 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
163 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
28 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
286 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
294 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
67 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
91 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
142 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
78 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
52 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 ...