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
8 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
12 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 ...
1
vote
2answers
38 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
21 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 ...
2
votes
0answers
19 views

n-Knapsack and 0/1-Knapsack implementation

It seems alright to me with some basic test cases. The idea is, as I understand, to solve the sub-problems with smaller to bigger weights up until the maximum allowable weight, and to vary the items ...
5
votes
0answers
26 views

Best Process Chain Approach - Implementation Atempt

Introduction 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 ...
-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
40 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
39 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
28 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
17 views

JavaScript problem displaying variable in console.log [on hold]

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
106 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
128 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
60 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 ...
-4
votes
0answers
15 views

Send a user to a specific URL depending on his text field input [on hold]

User inputs a text in my text field. If his text matches a text in my "list," he is sent to a specific URL once he hits the submit button. I want mine to determine the user's text input from a list I ...
3
votes
0answers
21 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
45 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
47 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
53 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
17 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
48 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
58 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
25 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
63 views

Get multiple minimal number from array

I have script for get three values (minimal numbers) from array : ...
1
vote
1answer
25 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 ...
0
votes
0answers
23 views

After Using Youtube Video Close Bootstrap Modal [closed]

I'm using bootstrap modal and youtube video with iframe code. I've a problem about that. First of all bootstrap modal should open when browser is loading and It's ok. I did this. But modal should ...
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 ...
-3
votes
0answers
14 views

using a regular expression search to find a number with a comma inside it(12,345) [closed]

var matches = /\bI want at least (\d+)/i.exec(document.body.innerHTML); thats what I m working with. I need it to return the number that appears after the ...
7
votes
1answer
47 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 ...
6
votes
0answers
111 views
+50

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
36 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
27 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
16 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
64 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
240 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
39 views
11
votes
1answer
185 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 ...
3
votes
0answers
64 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
25 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
92 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
72 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 ...
2
votes
3answers
71 views

Save handler without a nested “deferred antipattern”

I have an application in which a user makes a change, and when they click Save they will be prompted to confirm, and the appropriate REST call will be made if they agree. The intial call to ...