Questions tagged [javascript]

ECMAScript or ES (commonly referred to as JavaScript) is primarily used for scripting web-pages but also has several embedded forms as stand-alone interpreters or JIT compilers. Use this tag for questions regarding all versions of ES up to the current ES8 and its dialects / implementations: JavaScript, JScript, etc., excluding ActionScript.

Filter by
Sorted by
Tagged with
1
vote
1answer
1k views

Jquery shopping cart code review [closed]

I'd really appreciate if any of you could do a code review of my Sopping cart demo. I was wondering whether this could be improved? I'm honestly trying to improve myself too! There's a small problem ...
1
vote
1answer
50 views

Large table updates using AJAX in Internet Explorer 11 (Cont'd)

Previous topic: Large table updates using AJAX in Internet Explorer 11 For the functions included here, I have taken the advice of the previous answer and incorporated it in the restructure, but am ...
1
vote
1answer
95 views

Notebook app for terminal

I'm currently enrolled in a node.js course. The first app we have done in the course was a terminal notebook. It appends objects to a json-file. Example call on the terminal: ...
1
vote
1answer
162 views

Node.js DataBase class for adodb databases

A while ago I was working on a multipurpose database class (an es6 javascript class) that works with any database supporting adodb. This class is a wrapper on the "node-adodb" npm library. This ...
1
vote
1answer
56 views

XMLHttpRequest in the browser

The intention is to implement an xmlHttpRequest in plain vanilla js while considering all possible errors and problem situations without crashing in the browser. Result and faults are to be properly ...
1
vote
1answer
89 views

A faster way to compute largest prime factor (Again, but a lot better)

I came up with this code after implementing the feedback given by @200_success. The previous one (A faster way to compute the largest prime factor) tested my patience, but still failed to give the ...
1
vote
2answers
80 views

First Unique Character in a String

The task is taken from leetcode Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: s = "leetcode" return ...
1
vote
1answer
563 views

Concurrent fire and forget async task queue

I had to do a lot of IO stuff on my server running Node JS where I did not really care about the result of the operations. The list of incoming tasks could be huge, so I had to limit the number of ...
1
vote
0answers
575 views

Simple Pub-Sub Event Emitter

I have written a basic event emitter in JavaScript and I'd like some feedback on my design. I tried to make it as simple and minimalist as possible, as I'd like it to be understandable by anyone. I ...
1
vote
0answers
20 views

Extract and manipulate date from SharePoint and export into Google Charts

I am extracting a list of data from a SharePoint library with CSOM, then manipulating the data to give some sort of visible statistic through Google Charts. The data is a list of each parent ...
1
vote
1answer
98 views

Advent of code 2017 Day 2 (2) in Functional Programming (FP)

I wanted to practice functional programming (fp) without using any library but using vanilla JS only. So I took a problem from Advent of Code (the 2nd part of Day 2): https://adventofcode.com/2017/...
1
vote
2answers
491 views

Adding and Deleting in ES6 Javascript Alone

I need help in making this as short as possible and it should follow the latest ES6 standards. It it already 100% working. But I need help because i want to follow the best practices in using ES6. The ...
1
vote
1answer
63 views

Edit and delete uploaded images code inside script tag

I am Displaying mask images & allowing user to upload the custome image inside mask image, now i want to give an option for user to Edit & Delete the Uploaded image.... Video link : https://...
1
vote
2answers
162 views

Minimum number of parentheses to be removed to make a string of parentheses balanced

The task: Given a string of parentheses, write a function to compute the minimum number of parentheses to be removed to make the string valid (i.e. each open parenthesis is eventually closed). ...
0
votes
2answers
62 views

Achieve error differentiation in Promises

Background I have a REST API using MongoDB, Node.js and Express that makes a request to my NoSQL DB and depending on different results, I want to differentiate which error I send the customer. ...
0
votes
1answer
3k views

Filling a matrix with values

I would like to hear your recommendations on when to use JavaScript's const over let, especially when applied to mutable objects ...
0
votes
0answers
53 views

Advent of Code 2017 Day 5 (part 2) in Functional Programming (FP)

I wanted to practice functional programming (fp) without using any library but using vanilla JS only. So I took a problem from Advent of Code (the 2nd part of Day 5): https://adventofcode.com/2017/...
0
votes
2answers
317 views

Submitting a form via JSON

I have a file named feedback.js that I would like to improve. ...
0
votes
3answers
3k views

Button to dynamically clone a form field

I am very new to javascript and started with a very basic add button to my django app. Everything I found was using jQuery but for only one small script jQuery seems to be a too big overhead for me. ...
0
votes
1answer
2k views

Toggle between two states in react

I have two fetch calls which updates the state. And I have two buttons. One makes a fetch call, another calls componentDidMount()...
0
votes
1answer
1k views

Pure JS multi-slide carousel

On our home page we need simple multi-slide carousel. It is our highest traffic page, so we decided to remove all libraries (including jQuery) in order to increase page speed. Functionality we trying ...
0
votes
1answer
76 views

Hosting a game on a server

I have the following code but it's a bit messy and hard to look at. I could include a function to host a game so that block of code isn't repeating, but could this be optimized any further? ...
0
votes
1answer
4k views

Form validation - security and input specification

So I'm working on a register form and I have four fields: name, username, email and password. I pick up the values of these fields in jQuery and depending on if all the fields are filled, I pass them ...
0
votes
1answer
1k views

Multi-Functional Event Delegate

I'm pretty new to JQuery, maybe a week's worth of experience, but I'm having a lot of fun so far. One of the things I thought I would give a shot is attempting to implement a custom CMS for my current ...
0
votes
1answer
36 views

Follow-up zp-Tree to represent Trees as nested arrays: 3rd (final?) revision

This is a follow-up on my previous post. I have made modifications based on the feedback received on the previous post, hence I request a third (final?) review on the modified code if ok. Note: ...