Tagged Questions
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 ...
0
votes
0answers
6 views
1
vote
0answers
10 views
Pomodoro clock in js
I created a JavaScript library on Pomodoro time management method. I don't know if it's good so I though that you can help me with reviews.
...
0
votes
0answers
22 views
1
vote
3answers
55 views
Grade student as number of array scores
Assume that you have the ready sorted array
Is it a good solution?
Plunker OR:
...
-3
votes
0answers
29 views
javascript reduce the complexity of the code
i have to refactor the following three functions and trying to reduce the Cyclomatic complexity of the function.
...
1
vote
1answer
35 views
Count the number of vowels and consonants
So I needed to write a function that takes a string and returns a javascript object with vowels and consonants properties that maps to the number of vowels and consonants in the string
...
1
vote
0answers
24 views
jQuery placeholder plugin checking
I have been experimenting with jQuery and HTML placeholder plugin for practice work.
I've used this jQuery plugin. I've checked it in IE8 in, it seems it works.
Could you please check and write is ...
2
votes
1answer
64 views
Online notepad in JavaScript
I have been told for my code below i need to "Improve and optimise the codebase of the application to reflect modern and best coding practices". Can anyone help me in doing this? As I know the service ...
0
votes
0answers
8 views
psql event store
Below are a couple of different files that comprise of example code for a postgres event store, where rows for one main table events are created, as well as a ...
3
votes
2answers
57 views
Restrict HTML input field to decimal
I'd like to restrict user input in a form to a decimal with max two numbers before and 4 after decimal point.
Valid values would be:
50
0.1
1.23
4.5678
12.943
...
1
vote
0answers
19 views
Getting data from service and storing it in MongoDB
I wrote code to get data from HTTP service and store it in MongoDB. Please, can someone let me know how efficient my code is and whether it is good from the OOP point of view?
...
3
votes
1answer
43 views
Integrating the Ace embeddable code editor for editing HTML, CSS, and JavaScript
I am currently implementing the Ace-editor embeddable code editor. In to my application.
I use a div with a certain class(example: editor_js) to render the editor the div also gets a data attribute ...
0
votes
0answers
18 views
3
votes
1answer
41 views
Generating jQuery mobile “pages” dynamically
I'm doing a college assignment with jQuery Mobile and JSON. Best practice with jQuery mobile is my main concern.
My html starts off with a main 'page' (data-role="page") inside a div with ...
0
votes
1answer
36 views
object.Storage.js - creates a namespace for Storage
This basically creates a namespace for Storage among other things. I'm looking for feedback on the structure of the code.
...
-1
votes
0answers
19 views
object.ErrorHandler.js - handles errors on bubble and capture phase
Is this a good way to handle errors? Right now I'm using it to capture image errors, but I want to expand it a bit.
Can I catch runtime errors this way?
...
1
vote
0answers
12 views
TinyMCE plugin to save with cancel button
Please provide constructive criticism for this TinyMCE plugin which allows the user to save the content, or cancel and go back to the original.
JS Bin
...
1
vote
1answer
18 views
Logging errors in google analytics
Apart from general JavaScript knowledge, this snippets requires someone who knows how to properly use Google Analytics API.
To log errors on my site, I use this code:
...
-1
votes
0answers
14 views
Toggle Fullscreen with Click and Hotkey [on hold]
When clicking Red Square it works, when pressing F does not work in IE11.
Both methods use ...
0
votes
1answer
28 views
JavaScript-function for to convert a dash-separated string into camel case
I have to write a function which turns a string with the words separated by dashes ( - ) into a sentence using camel case notation.
I've had the following idea for an implemenation using the ...
0
votes
1answer
55 views
Node module server.js exports modules
I'm using the following code which is working and my question if there is a cleaner/ better way to write it ?
...
3
votes
0answers
22 views
object.TitleMaker.js - How can I make this Title Maker better?
It creates a title for the page by extracting it from the domain name.
Right now it looks kind of boring like someone tyring to mimic typing. Are there any better effects I could use, etc.?
...
0
votes
0answers
10 views
Flattened Data Model and noSQL data structure
I am currently building a small application using a service which requires and advocates the use of a "flattened" data model (the service is Firebase).
As I had no experience with data models before, ...
1
vote
0answers
47 views
Hunt n' Kill algorithm
Last day I implemented the Hunt and Kill algorithm in JavaScript, using HTML5 without any libraries. I would like my code to be reviewed.
How it works
I start with a 2D array filled with walls ...
2
votes
1answer
42 views
Linkedlist visualization using html5 canvas
I have written a simple linked list visualization program in JavaScript:
I am just a beginner in html5 canvas. I am pretty much satisfied with how it works, but I´d like to know if I made some ...
1
vote
1answer
63 views
Callback/Promises implementation for a boolean check
Currently I have the following callback system:
...
1
vote
0answers
27 views
Selectively mapping one object to another
I'm taking an input object and returning a reduced and slightly changed object:
...
0
votes
1answer
26 views
Detect if ie10+ and edge is using inPrivate mode
This is an odd case scenario, but I would like to display a message that tells if indexedDB is not supported or if it is removed due to being in private mode (yes ...
3
votes
1answer
26 views
BlackJack in Angular
I wrote the following code in Angular as to accomplish a technical test for a UK job. My impression was that it is very neat and well object oriented. To my big surprise, they rejected it. Could ...
0
votes
1answer
36 views
Custom multiple div appends in JavaScript
I hope you can get me out of my current predicament which involves coding style when it comes to appending many elements in a pretty flexible and typesafe way.
Now I see my code below and I feel that ...
0
votes
0answers
15 views
How to implement GET and POST in Node with built-in http module [on hold]
This is my basic implementation of a http get and post with node built-in http node module.
I would like to keep this module standalone (no external module ...
1
vote
1answer
32 views
Number-system converter in JavaScript
I have made this app to get a bit more familiar with JavaScript and CSS.
I functionality seem to work as expected. Although I've noticed problems with the flexbox-layout in Firefox. Currently no ...
1
vote
1answer
38 views
Concat strings from Object or Array
How would you merge these two functions into a single more generic function?
...
0
votes
0answers
19 views
Optimize JavaScript chain calls [closed]
I have the following function for bundling my JavaScript modules:
...
0
votes
1answer
29 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: ...
2
votes
1answer
43 views
Add items to a list, or update the quantity if already in the list
I have several lists that contain Part objects with a partNumber and quantity. When the user ...
4
votes
1answer
58 views
JavaScript calendar widget
I'd like to know how I can refactor my JS code for usability.
Currently my JavaScript uses some HTML to build out a simple calendar with the following functionality:
a. opens into the current month ...
6
votes
1answer
26 views
When values are pasted into a bigger range, the values should be repeated as needed to fill the range
I am currently working on a project, and I just wrote a piece of it that requires a lot of array manipulation. Given a text input I want to expand it to fill the number of rows and columns I have. I ...
1
vote
1answer
38 views
Cross browser JavaScript implementation of xhr
I wrote a small, cross browser compliant implementation of xhr requests in client JavaScript that closely follows the jQuery $.ajax() API and standards. The goal is ...
0
votes
1answer
19 views
Follow-up zp-Tree to represent Trees as nested arrays
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 another review on the modified code if ok.
Note: review ...
0
votes
1answer
19 views
Loading URLs via a case statement
I have the following code which loads in a URL based on the id of a user-clicked button. I'm looking to compress it down as much as possible, and make it more modular and reusable:
...
4
votes
0answers
32 views
Passport user authentication
I'm using Passport in Node.js app to authenticate user by email and password (login) and also by token.
Email and password are used only when user is logging in. Passport local strategy generates ...
2
votes
3answers
49 views
Tag dependence approach
I need to add class is_active to all div's when I click on <div id="all-tags"> and remove class if I click again. Only ...
0
votes
1answer
25 views
A javascript equivalent for toDictionary (c#)
I made a function that should ease the making of new objects out of objects or arrays.
I extended underscore so thats why the _.
...
0
votes
1answer
24 views
Data-structure “Singly-Listed List” in JavaScript
The purpose of the data-structure is to manage person-objects.
Persons can be added at any time. But the order can't be changed afterward.
Only the deletion of a person is possible. Represents the ...
2
votes
1answer
42 views
A small custom encryption / decryption script
I have made a small script for encrypting data. Now I'm wondering how efficient it is for normal users who aren't programmers and for people who are programmers.
I mean if you don't have this script ...
1
vote
1answer
33 views
Expanding list on webpage
The below produces the output I want. Namely, it initially displays the first item on the list and the first expander link. When an expander link is clicked, it hides that link, unhides one more item ...
1
vote
1answer
39 views
zp-Tree library to represent trees as nested arrays
For my project I have rewritten a small lib for a tree structure that was inspired by wangzuo's js-tree.
The reason was largely because I prefer to work with an array structure rather than nested ...
1
vote
1answer
20 views
Custom Kit Form Validation
I have an HTML form where I need to do the following
when value of Select Box changes to initial "Not Selected" value (where values of the option is 0), I am to highlight the select box, when it's ...
2
votes
1answer
15 views
JavaScript idle managing structure
I am just getting into the world of javascript, coming from the world of classical inheritance. The following is a library I wrote to track when a webapp is idling and I wrote it like I write ...