ECMAScript (commonly referred to as JavaScript) is primarily used for scripting web-pages but also has several embedded forms and stand-alone interpreters / JIT engines. Use this tag for questions regarding ECMAScript 5 or 6 and its dialects / implementations: JavaScript, JScript, etc., excluding ...

learn more… | top users | synonyms

2
votes
0answers
19 views

Show list of states depending on user selection

I have some data that needs to bind to my view depending on the user selection. Example: changing the list of states in a dropdown depending on the selected country. My understanding is, there are ...
7
votes
1answer
162 views

jQuery code to create web alert

I wrote the following code using jQuery to create a WebAlert instead of using the alert() function from jQuery: ...
1
vote
1answer
30 views

Resumé builder app

Wrote this an hour or so after learning some basics. Took me a while because I had to write it in a way to fit the previous structure of my page. Basically, there are three rows of data. There HAS to ...
2
votes
0answers
31 views

Chrome extension to get youtube video's URL

I needed something that would get the URL of a chosen video from YouTube and store it in a file. Since I didn't find a way to write/edit an existing file with the URL alone, I had to use a patchwork ...
0
votes
1answer
18 views

Access resolve function outside of a JavaScript Promise

I have an object that needs to have a single point of initialization, and other callers need to wait until the initialization is complete before continuing. I have done this with jQuery, and it feels ...
-3
votes
0answers
14 views

Looping form input [on hold]

Please help me how make looping form working, the problem is if have one row its working when change quantity then java auto sum total. But when i add row again contain same value, when i change ...
0
votes
1answer
22 views

Initializing a namespace tree

I have a global namespace where developers attach object singletons, class definitions, constants, etc. Each JS file has its own crafty flavor of namespace tree initialization. Maybe a module pattern ...
2
votes
1answer
60 views

Finding the largest word in the given String

If there are two or more words that are the same length, return the first word from the string with that length. I am a beginner. Could anyone highlight good and bad parts of the following ...
3
votes
0answers
31 views

Drills: A JavaScript web application that creates customizable workout routines and reads commands aloud while keeping track of time

Here's the JSFiddle, the GitHub repo, and here it is out in the wild. Note: the application uses Chrome's Speech Synthesis API and only works on Chrome or Safari for iOS7 (oddly enough). It was my ...
5
votes
1answer
36 views

Process chain approach

I've been researching about JavaScript and jQuery function chaining and different callback techniques. I am trying to create a very generic code that allows chaining, and in a way that I may create ...
-4
votes
0answers
25 views

Formatting data in input field [on hold]

I have a phone number field on my form. Here is the code: ...
5
votes
1answer
43 views

Desktop Notifications for Queue Items - Updated Code

A while ago I took one of @Simon's scripts and updated it to make it more geared towards normal users (no offense mods) and this Question was created. But the link to the Github is no longer correct ...
3
votes
1answer
43 views

Froogaloopelise - A Vimeo Wrapper

I have developed a tiny bit of JavaScript to quickly output a Froogaloop Vimeo video and some basic controls attached with almost no effort. You don't have to include the script from Vimeo (the script ...
4
votes
1answer
31 views

Promises with NodeJS and BlueBird

I'm using bluebird for promises in my Node/Express application and wrote an API call in which the user passes in a JSON Web Token that contains their user ...
1
vote
1answer
30 views

Adjusting the height of a div to match that of another column

This code checks whether an image whose parent is .papers.left has completely loaded into DOM and if yes then the background of ...
-3
votes
0answers
18 views

JavaScript problem displaying variable in console.log [closed]

I am currently taking an online class and there is one unit on JavaScript/Jquery. As this isn't the focus of the course I am kind of lost. I have been following along and I did everything as shown but ...
5
votes
3answers
111 views

Numerology Calculator

I've built the beginnings of a numerology calculator, and would like an experienced javascript developer to review this code. It works as expected, but I can't help but think there is a better way to ...
6
votes
3answers
134 views

Revealing store sales based on time

I am delving into trying to write some JavaScript code. I understand the basics, (the very basics...) enough that I have been able to write the following and it works. However, my knowledge doesn't ...
5
votes
2answers
62 views

Lazy loading social buttons on mouse enter

I am using the following code to lazy load some social buttons in my personal blog. Before continue, I would like to enumerate some dependencies first: jQuery 2.1.4; Using Font Awesome 4.1.0 (but ...
3
votes
0answers
22 views

Using Angular directives for connect HTML clicks in buttons and controller actions

I'm trying to improve my Angular directive. I'm pretty new to CoffeeScript, so I think there may be inconsistent code. ...
3
votes
1answer
47 views

Printing a huge document

I have a web page containing n pages of paged data, showing 20 records at a time. The front end has a link to another page that opens the same data, but without the paging and calls ...
1
vote
2answers
48 views

Increment number in jQuery

I have this number returned from an Ajax request: 015-0011-00001. I want to increment the last part of the number (00001) on ...
-2
votes
1answer
56 views

Finding the modes of an array

I've a working function. But it feels complicated and doesn't look too good, I would like to improve it. ...
0
votes
0answers
18 views

jQuery plugin that filters and orders boxes with CSS transform

I made this jQuery plugin based on MixItUp and Isotope. In short, one needs to create an <ul> list filled with <li> ...
0
votes
1answer
37 views

Structuring a JSON array with objects

I have a JSON array or literal (passes through JSON.parse). Requirement: an array of tasks which contains operations which are key/value pairs. Array of tasks > Array of operations (array of ...
2
votes
2answers
46 views

Controller method to validate and save

I have built RESTful web services. The services endpoints have a similar logic: If the input validation succeeds, do a database operation and return the result. If the db operation fails, return the ...
5
votes
0answers
50 views

Typing exercise app

I've been writing a program to improve my Javascript skills. It's a very simple app for typing practicing. ...
5
votes
0answers
60 views

Attempt at type-safe enums in JavaScript

I wrote this tiny library yesterday. The goal was to implement enums in JavaScript with type-safety. I modeled the implementation similar to enums in Java, since that is what I am most familiar with. ...
2
votes
1answer
26 views

Create a Tree Node from JavaScript Array

I'm trying to create a list of subpaths from a flattened array. Here's the starting point: ...
4
votes
3answers
64 views

Get multiple minimal number from array

I have script for get three values (minimal numbers) from array : ...
1
vote
1answer
26 views

Menu visibility toggle method

I've just created a method that toggles menu visibility. At the moment I've gone with an if..else which checks my flag and acts ...
4
votes
2answers
55 views

A function that checks for duplicate elements in an array

Is there a simpler way to implement this function? ...
3
votes
0answers
20 views

Getters, constructors and eval

I'm trying to parse an object generated from an Excel file. The output lists each cell with its contents. If the cell is just a number then it remains a number but if the cell contains a formula (has ...
7
votes
1answer
48 views

Retrieving StackExchange sites and tags

I have setup agenda tasks to periodically retrieve and possibly insert new SE sites and tags in my MongoDB database. Some things that bother me in particular: Lots of code duplication No string ...
12
votes
1answer
157 views

Java Spring Example Web API

I'd like to get some feedback on an example web API I've put together. It's mavenized and available on GitHub here. Setup The only thing you'd have to change to run this locally is line 31 in ...
2
votes
0answers
37 views

Loading and rendering images from MongoDB

I'm playing with Node.js/Express.js/MongoDB and I want to write module to include all MongoDB related functions. My goal is to build simple app to load small jpeg images from MongoDB by _id and render ...
3
votes
1answer
30 views

Greasemonkey script to refresh page until target string is found

I've been working on this user script to hunt for a specific string in an HTML webpage with the goal of finding the time at which it appeared. This feels needlessly complicated and I would like ...
2
votes
1answer
17 views

Deep cloning and modifying containers from ReactJS this.state

I am presently working on refactoring ReactJS code away from directly manipulating this.state and towards using this.setState() ...
1
vote
0answers
24 views

Turning a 2D array into a tree

I have the following data structure that's obtained from a third party: ...
4
votes
2answers
65 views

Finding patterns in a string

I'm trying to find patterns of different length in a given string. How can I improve it? Are there problems? ...
26
votes
1answer
241 views

Beta-Blue B. Gone

I've written a Code Review design using Userscripts and CSS. It works by fetching the CSS from my GitHub repo, and using the built in gm_addStyle function to add ...
1
vote
1answer
16 views

Keyboard shortcuts Customization

I have created keyboard shortcuts menu,same as like this stackoverflow keyboard shortcuts.In multilevel. Scenario ...
3
votes
1answer
41 views
11
votes
1answer
187 views

Cardshifter web client deploy script

The Cardshifter web client is coming along! The game client is a web app written mostly in Angular.js and is hosted at at play.cardshifter.com. @SimonForsberg (who runs the server) is getting tired ...
4
votes
0answers
68 views

Canvas animation of network nodes and edges

Having to give the idea of an ever changing network of nodes (each with different impact and possibly more than one color) connecting each other to create something. I wanted to give it depth ...
6
votes
2answers
182 views

jQuery plugin to cycle through text and “typewrite” it out

I have written a jQuery plugin (my first for a long time) that simply cycles through strings of text in a data attribute and uses setInterval to type it out - it's ...
1
vote
2answers
79 views

Reduce jQuery append method

Is this the simplest way to write this? This code evaluates if a textbox value exceeds 20 characters, and then displays the proper message (essentially truncating the string and then adding an ...
2
votes
1answer
26 views

Aggregate sum by month

I have JSON data: var data = [ { dat: 'timestamp', val: 10 }, { dat: 'timestamp', val: 20}, (...)] Data contains objects with timestamp and value, can be more ...
11
votes
1answer
95 views

2D Gravity Simulator-like game

This project is pretty much like a 2D gravity simulator. You click and it creates a circle that attracts other circles. The result of a collision is a bigger circle that is a sum of the masses. If you ...
3
votes
1answer
75 views

Phone number format and data entry restriction

I created a form that formats phone numbers, allows only allowable keys to be pressed, and converts a lettered entry into its corresponding phone keypad number. Is there some cleanup or better coding ...