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)

-7
votes
0answers
24 views

Glitches in the programming? [on hold]

I want to make a sidescroller game in an HTML canvas program. I've looked on how to do it, and think I know what to do. Unfortunately, whenever I open up the program, It shows a blank page. Any help?
0
votes
0answers
20 views

Securing ajax call to local API

Our application is consuming 3rd party API by making an ajax call to a local MVC controller action (call to a 3rd party API is being made from our our server, using server side script). 3rd party API ...
-3
votes
0answers
28 views

Transform array of strings to a multiple level menu [on hold]

I am programming a simple app to learn. I want to be able to create a multi-level menu from a minimal definition like this array: (name;order) ["File;1|Open;10", "File;1|Save;20", ...
-4
votes
0answers
24 views

CSS/Html structure of span [on hold]

I'm trying to get an asterix "*" to appear directly above the "pp", however if I try to insert this in a span adjacent to the span containing the "pp", it does not sit above as desired.. Can ...
-6
votes
0answers
33 views

How to do rollups such as that on http://www.hooli.xyz/#inspiration [on hold]

Looking at the front page of the website I am developing and I am considering using the same technique as that in the Hooli spoof website http://www.hooli.xyz But having looked at the source - which ...
-6
votes
0answers
32 views

Accesing Java Script Variable inside Java in Jsp File [on hold]

function x(){ var b=document.forms[0].name.value; <% System.out.println("b value is:"+b); %> } is there any way to access variable 'b' inside java code
-3
votes
0answers
44 views

How to generate a single .js file containing all dependencies from npm or bower? [on hold]

The files that Bower and npm retrieve for a project include a complete copy of the source code. This may include all kinds of files besides the actual JavaScript code, like tests, configuration files, ...
-6
votes
1answer
39 views

IntelliJ Community Edition Javascript Support? [on hold]

This question is eating my mind. IntelliJ is a program which has two different distributions, Ultimate and Community editions. They have Javascript support in Ultimate edition but not in Community ...
0
votes
0answers
38 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 ...
-3
votes
0answers
47 views

How to use Sweet Alert Confirm [closed]

I'm trying to use sweet alert for delete, but it delete first without confirmation. I know there's something wrong with my script. The Deletion works fine, the thing is I want to prompt sweet alert ...
1
vote
2answers
48 views

Isormophic javascript, request processing

I was wondering why isomorphic JS, like using reactjs in both client and server side increase first page load ? What is different from simple SPA applications ? In both cases we are loading the full ...
4
votes
4answers
192 views

In CI, should tests be run against src or dist?

I've had a dispute with a colleague about when to run JavaScript unit tests in a CI environment at one of two different times. Let's call the two parties PE (pro-early) and PL (pro-late). Early ...
0
votes
0answers
55 views

Declare data in HTML [closed]

When working with Angular, jQuery or other Javascript frameworks, I often want to build components to which I can reference and pass data from my HTML. I work with e-learning, so an example relevant ...
-7
votes
0answers
40 views

Ajax not working [closed]

With web help I use this code in one page, now I want use it again and doesn't work! I tried everything and is stupid. Let me show you: ****************************index.php******************** ...
5
votes
1answer
224 views

How can I go about testing this javascript?

I'm working on a project that has me responsible for testing out some software that scrapes a web-page representing an input form, and generates a mobile friendly version of that page. This is ...
-5
votes
0answers
49 views

Split image into small pieces and set together as background [closed]

I have a really big background image for my website and I dont want to scale down the image for better performance because it will also lead to a quality loss. So my question is now: How can I ...
-6
votes
0answers
35 views

How does Stripe implement the fly-in particle effect on their open source page? [closed]

https://stripe.com/open-source When the page loads, the title OPEN SOURCE has the particle flying in animation. Is this done programmatically or otherwise? If programmatically, can someone shed some ...
1
vote
1answer
47 views

How to properly manage “business” constants with AngularJS?

I'm working with AngularJS on a browser game and I have a bunch of "business" constants. These constants will be often updated during game testing (game balancing) and are used by different ...
0
votes
3answers
69 views

Multiple Canvas in the Browser — How to Proceed?

Here's something I wrote ages ago as Java applet. I want to convert it into JavaScript and run in html5 canvas in the browser. From what I can see, canvas makes the most sense here. (SVG / DIV ...
0
votes
0answers
29 views

How to convert JSON Stringify to Object JavaScript? [migrated]

I have example : var data = [{"name":"eric","age":"24"},{"name":"goulding","age":"23"}] I want to convert json above to object like this result : [{name:"eric",age:24},{name:"goulding",age:23}] ...
0
votes
2answers
275 views

How are complex programs made? [duplicate]

I know a few languages, and can program in them. How do multiple languages blend together in a single program? For ex. https://github.com/facebook/watchman. This uses C, PHP, Python, Javascript, etc. ...
-2
votes
0answers
18 views

Writing my age in decimal format [migrated]

I'm trying to write my age in decimal format (eg. 28.232423424) in Javascript and have this number update in real time. An example of what I'm trying to do can be seen on this page. So far, I have ...
0
votes
1answer
30 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
33 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
148 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 ...
2
votes
2answers
186 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
1answer
60 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
56 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
91 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
81 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 ...
-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 ...
7
votes
2answers
173 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 ...
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
124 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
0answers
35 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
287 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 ...
0
votes
0answers
28 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 ...
3
votes
1answer
138 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
1answer
83 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 = { ...
0
votes
1answer
82 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
231 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. ...
0
votes
2answers
85 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 ...
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
117 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 ...
28
votes
1answer
894 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 ...
2
votes
2answers
114 views

Javascript Password Security

I'm extremely new to javascript (so I know there's already a thread here), but I couldn't understand how to implement it. My code is pretty much identical: <script language="javascript"> ...
2
votes
6answers
737 views

Replacing C with JavaScript as an introductory programming language [closed]

I am a new teacher at polytechnic where we teach web development and basic software programming. For years, the institution where I teach have taught C as their introductory programming language to ...
0
votes
2answers
81 views

Using PHP without mixing presentation logic

I'm conceptually designing a website / application and trying to come up with the correct separation of concerns. The basic technologies I'm settling on are: MySQL, PHP (Laravel), HTML/JS (jQuery). ...
3
votes
2answers
76 views

why regex, when using global search and {0,} quantifier, match the end of the string?

I have asked a question here about js, regex, quantifiers and global search. I've understood finally how this works, but, let's take a concrete example and then I`ll write my question. Based on the ...