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

-4
votes
0answers
24 views

Java Script Codes [on hold]

Please I need urgent your assistance 1) How to change the text on the Java Script error alert window. "attached No.1" It says JavaScript Alert: the following error(s) required. Can we change the ...
3
votes
2answers
66 views

Mutually exclusive radio buttons

Here is a small code snippet I wrote that I feel is pretty naive. I copied the code directly from my project and renamed some ID/class names. I'd like to know how you could help to improve/refactor ...
3
votes
1answer
44 views

Creating a symbol toolbar with Angular

I have been given a requirement to create a symbol toolbar, a toolbar where each button represents a unique symbol. This is how the toolbar would work: A user clicks inside a text field and enters ...
-1
votes
0answers
21 views

Microsoft Logo Animation v2 [migrated]

I updated my animation of the Microsoft's logo. It's available on CodePen. Overall, I am quite satisfied with it now apart from one thing. I cannot seem to figure out how to stop the animation so the ...
5
votes
1answer
52 views

Small Calendar “Widget”

I have been working on a calendar widget for the past hour or so. I wonder if it could be compacted any more than it already is (ignoring whitespace). ...
0
votes
1answer
38 views

snapping code: from separate checks to 1 formula

I'm working on a 3D-project with three.js and webGl. I've written a function to check for 2 objects to be near each other and thus "snap" to each other. The objects don't move on the Y-axis, so I ...
3
votes
1answer
34 views

Maximum number of values in an array

I have an array to have a maximum of 10 elements. Whenever I add a new element, if it already has 10, it would remove the first and push a new one. I made this: ...
1
vote
2answers
32 views

Getting paginated data from ajax call and putting the data on the page

At the moment, it gets the first page worth of data and then each subsequent page when the user scrolls down to the bottom of the page. My JavaScript/jQuery level is fairly weak, however I have ...
10
votes
2answers
1k views

Microsoft logo animation

I made an animation of the Microsoft logo. It's available as a CodePen doodle, also. Would anyone be so kind as to check my style and say if there is anything I could've improved? (I am sure there ...
2
votes
2answers
35 views

Loading more items for an activity feed that uses a global page counter

I have this script which is for a news feed. A button click will grab more data from the server if there is any and then add it to the box. It doesn't allow any more than 10 pages of results currently ...
4
votes
0answers
32 views

Recent top tags in Tumblr blog

A friend of mine asked me to write a script for showing the most used tags in her Tumblr blog in the last days. I saw it as a great opportunity for learning JavaScript and accepted it, as it seemed ...
3
votes
1answer
50 views

Generating a day event calendar based on an array of objects

I wanted to get some eyes on some code that I wrote, and see if anyone can help improve what I did. Just looking for some constructive feedback to help make my code more performant, and more elegant. ...
3
votes
0answers
23 views

Search Class with Static Methods

Most of my programming experience is in PHP, and I have always been a bit wary of JavaScript. I have a JavaScript class to manage executing, caching and displaying search results. ...
12
votes
3answers
113 views

GitHub link oneboxer for chat

I've made a userscript that oneboxes links to GitHub repos, issues or pull requests in Chat after seeing the request One-box repositories, issue tickets and such on GitHub in the chat on Meta. It ...
2
votes
0answers
33 views

Fading Alert boxes

I am currently working on some fade out alert boxes where once the fa-close is clicked, it will then fade out and then slide the rest of the alerts/content upwards. ...
0
votes
0answers
20 views

jQuery resizable plugin

Is there any way I can simplify this re-sizable solution? It seems too difficult and messy to me. Working example ...
2
votes
1answer
16 views

Mini shopping cart for a site on MODX

Please help in improving the code. I would like to hear comments on: syntax an approach to development This is my first experience in writing a simple application for the site. ...
2
votes
0answers
43 views

Profiles with profiling checkboxes

I have this HTML down below that creates a list with two columns, the left one containing profile information, and the right one containing checkboxes of the user feedback in a horizontal list. The ...
4
votes
1answer
43 views

Xonix game in JavaScript/Canvas: detection of conquered regions

I've written a Xonix clone in Javascript/Canvas. It seems to work fine. However I would like to refactor the code of detecting conquered regions which seems to be bulky (see methods ...
0
votes
4answers
38 views

Generating an array of unique values of a specific property in an object array

Given a table represented as a javascript array of objects, I would like create a list of unique values for a specific property. ...
1
vote
1answer
19 views

Quickly passing and parsing variable length float arrays

I have this code for parsing for parsing a list of floats of variable length. ...
0
votes
1answer
34 views

How to simplify this js function?

Is there any way to make this function shorter? I want to calculate the characters up to 1.000.000. My reverse function looks like the same also... ...
-4
votes
0answers
23 views

How to convert this cycle into Linq.js or just linq [closed]

My code is written in JavaScript ...
-4
votes
0answers
12 views

All possible pairwise product of two-digit numbers [closed]

I'm trying to print all possible pairwise products of two-digit numbers, and this is the code I'm using (Javascript). ...
-1
votes
0answers
27 views

Call methods from object inside the init [closed]

I really like to use this pattern where I initialize the variables inside init. What I want know is about calling other necessary methods. Is there a way that I ...
5
votes
4answers
229 views

Basic web calculator

I've built a calculator. I would not use angular or bootstrap because I am becoming addicted to them. I also wanted to check for double '.' use, and to limit the screens max text length but did not ...
2
votes
2answers
48 views

Frequent Posters Sorting/Filtering by Date in JavaScript

I submitted this exercise for a potential job. I really was hoping to get some meaningful feedback, so I can improve. Instead, they gave me a one line response: "showed a limited understanding of ...
-1
votes
0answers
17 views

How to edit contents of overlay [closed]

I am trying to modify the contents of the overlay the below link will show. ...
-2
votes
2answers
44 views

Prefered language code refactor [closed]

I would like to make this code more elegant and have it written in a more standard manner, but I cannot write anything better with my current JQuery knowledge. So I would appreciate any suggestions to ...
2
votes
2answers
30 views

Live price update with options

I'm very new to JavaScript, so I'm not sure how to optimize the following code (which seems to run fine) further, though I did try to implement a few tips found on the web — such as using local ...
13
votes
5answers
2k views

Function that abbreviates a number (e.g. 1202 => 1.2K)

Like Twitter and Instagram and others I wanted to display numbers like 1.2K and 3.8M etc. My function works well enough but I would appreciate any input you may have. ...
-3
votes
0answers
22 views

How to make a batch code to process form inputs from websites? [closed]

I was wondering whether it would be possible to make a batch file that could be used to process form inputs and even be used to create a database and respond to the form input on the webpage like.If ...
4
votes
1answer
89 views

Personal portfolio website

I recently created this website for use as a portfolio because I thought it would help set me apart from other internship applicants next summer. I created this website using a mixture of pre-existing ...
1
vote
1answer
71 views

Simple JavaScript quiz

I'm learning JavaScript and have tried making a simple quiz from scratch. JS Bin ...
7
votes
1answer
49 views

Animating a 2D particle “web”

I have written a small class to generate and animate one of those trendy particle webs. I plan to use this as the main background of my personal website, so naturally I'm concerned about the ...
3
votes
2answers
60 views

Drop down menu plugin

I am making a dropdown menu in JavaScript for my website, and recently I decided I wanted to make it a plugin (as in, upload it on the web and make it compatible with other plugins). I am new to ...
2
votes
1answer
23 views

Create folder and export resolution ratios for artboard

After searching the internet, I was able to find a base JavaScript file in order to build upon for my project. Which is to create a Adobe Illustrator Script that will create the desired Folders and ...
3
votes
0answers
52 views

Appending script elements with variable attributes

eWay has a simple Pay Now button that is embedded as a script. There are other ways to use the eWay API to take a custom payment, but they are slightly more complicated and the idea was to keep it ...
25
votes
4answers
1k views

Determining if two words are anagrams

I was given a this problem at a technical interview and failed miserably in the time given. Afterwards, I sat down and worked out what I think is a good solution. The task was actually to build an ...
0
votes
0answers
31 views

Single page web mini app clients

Task: a one-application separation of logic. I'm just learning to write patterns MV*. Have I used shared model of view? View: ...
0
votes
0answers
32 views

Creation of a list of 1000 items with Backbone

I'm really new to web developing and Backbone. I would like some advices for better performance on this program I have written. I tried to write a program similar to these: React vs AngularJS vs ...
1
vote
1answer
35 views

Formatting MVC 5 Razor link as a string

MVC 5 doesn't seem to like JavaScript that much. I am creating link in JavaScript to a success method in my Ajax call. Razor: ...
4
votes
0answers
49 views

Datepickers for departure and return dates

I have to two datepickers. I want achieve a following functionality: when return date cannot be selected before departure and departure cannot be after return date. Mainly I am interested in ...
2
votes
0answers
33 views

Mocking the file system within a test

I've been using this method to test file-system functions as an alternative to mock-fs due to its lack of symlink support. I'd love to hear what others think and ...
-3
votes
0answers
20 views

Way of organizing function methods

Right now I have this function recursiveDeps that returns a raw deps object. I rewrote this function which originally returned ...
1
vote
0answers
34 views

Upload URLs of images as files to Parse.com

Using JavaScript cloud code, I'm trying to bulk convert a huge number of URL entries into actual files uploaded to Parse.com. This code works; I just want to make it cleaner/nicer. ...
2
votes
1answer
44 views

Toggle logical NOT operator based on a boolean value

I'm trying to think of a better way to write the below Javascript/NodeJS code without having to check the value of the boolean using an if statement. I know this ...
5
votes
2answers
439 views

Injecting JavaScript to website for ordering products

I am a newbie at programming and I helped my dad with making this program which orders multiple products to a website from a table of Excel. It involves 3 processes: Passing orders from Excel to ...
3
votes
1answer
83 views

Simple JavaScript autosuggest component

Any suggestions for improving this? I'm hoping for some JavaScript object structure / code integrity type recommendations rather than style or CSS. ...
3
votes
1answer
34 views

Width-based panel collapsion

This code adds the toggle functionality for mobile devices. So, for width lower than 990px, the panel collapses, and the user can toggle to open / close it. ...