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

0
votes
0answers
17 views

Ajax Done Callback to prevent requests from interrupting each other

I am trying to make sure my Ajax does not send another request before it receives a reply. To the best of my knowledge the code I will post is supposed to do this but I am still getting a -1 for ...
2
votes
0answers
9 views

Flash embed angular directive

I have an app that uses HTML5 video and our customer still needs to support IE8. Gross. Anyway, I came up with this directive in Angular to for embedding a SWF for when I need to fallback to Flash. ...
3
votes
1answer
22 views

Polyglot function to sum all the numbers in an array in Javascript and PHP

This, again, is a very simple code. This is my 2nd polyglot question and this time I've tried to do something that I miss sometimes in Javascript. PHP has the ...
1
vote
1answer
35 views

Certainty of two comparative values (A/B results certainty)

I'm trying to output the percentage of certainty of two comparatives data. Here's the resulting code: ...
-2
votes
0answers
12 views

show the multiple divs with images,links and text,once a selected,other can be hide in JS/Jquery [on hold]

i have a trouble to fix this problem.the problem is, i have multiple divs to show,with text and image,behind a link.i want to show one div in iframe when i select that div,.only that div can be show ...
1
vote
0answers
15 views

Get username from active directory if you know active directory Id in SharePoint

I have created JavaScript code using REST API for getting the username of a SharePoint user from an active directory if you know the ID. Please suggest any improvements. ...
-2
votes
0answers
6 views

How to check the vlaues of two array and based on that checkbox needs to checked [on hold]

I'm having two arrays, which contains the values. Out of which one array is always greater than other. I need to check the values of two arrays, if they are same the check-box needs to be checked. I'm ...
4
votes
1answer
25 views

Tiny JavaScript live filter

I'm looking for feedback on this live-filter I wrote in JavaScript. You can test it using the included snippet. ...
3
votes
1answer
24 views

An implementation of a double linked list

Here is my implementation of double linked list. Is it possible to reduce the code and improve it? Some methods here: head (returns head of the list) tail (returns tail of the list); append ...
2
votes
1answer
15 views

Determining cell direction in a 2D grid

I am making a simple function that retrieves a 3x3 cells out of NxM grid and determines the direction of cells base on their previous and next neighbor. It will return either any of the following ...
2
votes
0answers
31 views

Game of life in JavaScript - using Table

I finished coding Conway's Game of Life in JavaScript and HTML table. logic cells in a table will be assigned with unique id's and based on the ...
5
votes
1answer
65 views

Simple todo application

I have been learning HTML/JavaScript and CSS. I have gone through some of the online tutorials, PDFs and books as well. Though, now I am familiar with syntactical stuff, I wasn't sure how I should ...
-1
votes
0answers
11 views

click function not working for all elements [on hold]

I have a webpage that I've made responsive. When clicking the header I want the meny to drop down. This is currently only working with one of my pages. I have two that looks almost the same. Only ...
-1
votes
0answers
7 views

finding local shops in javascript html [on hold]

How I can search local stores by providing postal code or city in java script and html in googlemap.How I can search local stors by providing postal code or city in javascript and html in google map.
5
votes
2answers
78 views

Calendar in HTML + CSS + JS - Improvement suggestions

As I'm new to HTML + CSS + JS I've been building a calendar (which I think anyone can use as a basis) but would like to get your suggestions on how I could improve my code specifically from the ...
1
vote
0answers
16 views

Meteor Form Submission

Hello fellow Meteor developers. I am hoping a Meteor guru can please review my code below and verify if I am making proper use of return false and ...
1
vote
2answers
33 views

Lightweight localization for a Cordova app

I had been trying to find a suitable solution to implement localization in my Phonegap/Cordova application. My search proved that any localization through seperate .xml or .json files was a nightmare ...
2
votes
0answers
66 views
+50

My AJAX LiveDateTime Object

The following JS code object displays the date and time and updates whenever it changes. It has a sendAjaxRequest() function dependency to send the AJAX requests. ...
1
vote
0answers
19 views

Monitoring a few servers / API endpoints

I am trying to create a simple NodeJS program that monitors few provided servers or machines and provides output in JSON. ...
-1
votes
0answers
16 views

Eight queens on a chess board puzzle [on hold]

When I first saw the question: How to arrange eight queens on a chessboard such that they cannot attack each other I was intrigued by it, so I decided that the best way to answer the question was to ...
4
votes
1answer
56 views

Method for gaining access to private members in JavaScript for testing purposes

When running unit tests in JavaScript it is often useful to gain access to private members. Previously I would add an extra snippet of code inside the class definition (or whatever one calls this in a ...
2
votes
2answers
72 views

Equalizing heights

I'm running a jQuery function to equalize heights. I want to equalize the heights of several pairs of elements, and can't think of a way to do so without repeating the whole function. How can I ...
2
votes
1answer
33 views

Empty an array on focusout - jQuery UI Autocomplete

Is it good to empty an array on focusout? ...
3
votes
1answer
27 views

Bootstrap show many move one carousel modification

I've been steadily improving a show many move one carousel sample that I found a few weeks ago. I want to post my improvements for others to use but don't want to spread bad code. I'm not an expert in ...
0
votes
0answers
15 views

Race On - a gambling game (in beta) [on hold]

It's for six players. Each player writes six numbers from {1,2,3,4,5,6} down - any six (repeats allowed). They take it in turns to throw a dice. If the number is top of their list, they cross it off ...
6
votes
1answer
91 views

Simple todo list

Can someone tell me how good/bad this code is for a super simple todo list made from vanilla JavaScript? Anything to work on or consider on my next projects? ...
2
votes
0answers
35 views

MultiLevel JavaScript Inheritance

I'm making an experiment on JS, trying to build a framework for OOP. It's called Universe. The main purpose is to emulate a mini-universe, where classes are "created" with a defined behavior ...
2
votes
1answer
53 views

jQuery morphing button concept

I have written some code which makes a button morph into a container. I have written it using prototypes. I am fairly new to jQuery/JS so was looking for advice on whether this was a bad/good way to ...
1
vote
1answer
23 views

Navbar that adds and removes classes

I've written some jQuery for my navbar, but it's super sloppy and I'm always trying to write better code. ...
2
votes
2answers
74 views

Converting file from Markdown-like markup into HTML using repeated substitutions

The following code reads a file, splits its data, replaces some characters in the data, and then joins the data again (I added more details in the comments): ...
4
votes
1answer
60 views

Getting a value from a query string

I have a URL in this format: http://localhost:57279/AssociateCaseDetails?UId=176948&caseID=1123 I need the values of UId ...
3
votes
2answers
59 views

“Invert” a JavaScript object hash whose values are arrays to produce a new object hash with keys as the elements of those original value vectors

Background lodash and underscore have an invert function that takes an object hash and converts it to a new one, which has keys as the input object's values and ...
2
votes
2answers
31 views

Identifying clicked elements

I'm relatively new to web development. I started learning JavaScript a few months ago and it's going well. I made this code for someone on fiverr, and it got the job done, but I know there's a more ...
13
votes
1answer
164 views

Asteroids game clone

I have recently been teaching a JavaScript module on a games programming undergraduate course and I made this game as a learning exercise and as an example for my students to study. I have made games ...
2
votes
1answer
30 views

Show/hide description

I'm trying to keep the code as clean as possible. Is this the best approach? I don't use jQuery that often. ...
3
votes
0answers
38 views

Ajax file uploader jQuery plugin

I tried to write my first jQuery plugin. It's a very simple Ajax file uploader. I would appreciate a review of this code. HTML ...
3
votes
1answer
21 views

Spritesheet cut to individual frames

I need a hoverable transparent animation for a website, so that it glows when the mouse is over it. I could use two gifs or svgs one on top of another, but (as far as I know) there's no control of the ...
3
votes
0answers
35 views

Parse and format data on Google Sheets

This is a script I use on a Google sheet for parsing data that has been pasted from various other softwares and getting it into the correct format and columns on another sheet. Data is pasted into the ...
1
vote
1answer
36 views

Returning Function Calls from an Array within a JavaScript Function

I'd like to use JavaScript to generate HTML. I've made a JavaScript function object that has two parameters; a string and generic object. The string is used to specify the type of HTML element you ...
3
votes
3answers
78 views

Piccoche - a coordination game

Click the divs to remove them. Remove all div's in the shortest time and minimal clicks (to do). Code needs streamlining. ...
0
votes
0answers
15 views

Object oriented rugby analyser

I have this code which mimics a rugby match. You select a player by clicking the div (turns green), move it, and click to release (returns to default color). There is a bug, the mouse can move too ...
1
vote
2answers
45 views

Increasing FPS of updateMobs

I am starting to experience frame rate issues in my game and I've tracked it down to my updateMobs function. I would like tips and code examples from you guys to ...
4
votes
1answer
53 views

Simple morphing button concept

I have been making a jQuery morphing button type thing. jsFiddle ...
4
votes
0answers
36 views

ReactJS app to add and validate items to a list

I wrote a sample app based on the ReactJS tutorial, and I would like some thoughts on how idiomatic this code is. Unfortunately there's no ReactJS integration with Stackoverflow snippets, but I do ...
1
vote
0answers
52 views

Payment Gateway - single payment with credit card (handling path & choosing gateway)

This was an assignment and I am new to Node.js. You can find the complete project here. The code worked fine but was rejected, and wasn't given any reason even after asked. Statement: Create a ...
2
votes
3answers
57 views

Fixing navbar when scrolling beyond a certain number of pixels

I have written a jquery code, which fixes a navbar header on top of page when a user scrolls down to a certain pixels. But I am not sure whether is this the correct way to do this. Because this is ...
0
votes
0answers
26 views

Beginning of Markdown to HTML Node.js command line utility

Right now the code only works for paragraphs, bold, italic, headings, and converts straight quotes into smart quotes (a personal addition). ...
2
votes
0answers
20 views

React Flux structure for a shopping app

we have just started up a new app and we are using React with the Flux architecture, we have done our best to piece together what we think is the best structure for the app and would appreciate any ...
2
votes
2answers
44 views

Find index of an object with a specific value stored in an array

I am using the following code in order to retrieve the index for an object stored in a JavaScript array. Scripts works fine, but I would like your opinion regarding performance. Also would like to ...
0
votes
0answers
33 views

Rendering JSON array as a tree

This code is working fine for me, but I want to simplify it. Function parents is defining parents of the tree and children ...