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 ...
-1
votes
0answers
4 views
JavaScript object constructor uses prototype for shared values and methods?
My code works as expected and is adequate (cough) for my purposes, yet I have a feeling I am doing this all wrong, and have failed to understand something important, because instances of ...
1
vote
0answers
20 views
Modals that are centered vertically and horizontally within 80% of the browser size
I'm very new to website development. I would like to know if there is a much better, preferably with less codes, to write this modal.
Here is the full website assets if you need to look at how the ...
-4
votes
0answers
12 views
Program not functioning properly [on hold]
I am working on a program that if:
yes is selected on radio button 1, Radio button 2 enables.
If radio button 1 is no, radio button 2, 3 disables and clears. If radio button 2 is yes radio button 3 ...
2
votes
0answers
31 views
Voting app in JavaScript using Ramda
I'm just learning functional programming in JavaScript using Ramda.
I took this tutorial and implemented the server core.js component using Ramda.
The idea is that we'll have a collection of ...
1
vote
0answers
34 views
HTML scraping and using jQuery
I wrote a Chrome extension that lists upcoming concerts for the next seven days, this month, and next month. I had trouble with the nextSeven() method, especially ...
-1
votes
0answers
18 views
Creating model in the wrong place?
I'm developing an MVVM web app with kendo and it's now about a modal window. This modal window adds an item to a list. Every time the modal is opened, I need a new ViewModel instance and I need to ...
0
votes
0answers
32 views
+100
Splitwise clone done right
I have started this project basically for learning perspective and wanted to learn good object oriented design. What I am trying to do is making clone of something like this but this is a command line ...
1
vote
0answers
24 views
Universal sorting function with args
Input:
items = [{
name: 'b',
updatedAt: '1'
}, {
name: 'a',
updatedAt: '2'
}]
Args:
...
2
votes
0answers
23 views
JavaScript Tic-Tac-Toe web app
I am teaching myself JavaScript and made a little Tic-Tac-Toe web app. I'm not asking anyone to read through it all, but to just tell me what I need or should not do in the future.
...
-3
votes
0answers
13 views
output sha256 hash sums of partial segments of any opened file [on hold]
I maintain and own code written by someone else, and although I understand the basics of C++, I'm relatively new to modern javascript.
The code I have is supposed to open a file, then calculate ...
0
votes
0answers
19 views
Connection request to LinkedIn profiles on search page
I implemented a script for a LinkedIn user to connect with all profiles on a LinkedIn search page and move to the next one automatically.
As I am a new javaScript programmer, could someone look at my ...
1
vote
0answers
28 views
AngularJS login controller
Could somebody make sure that strictly AngularJS things are being used and not jQuery?
Is is good to keep validation message work in Controller?
Model Code
This is about sending request to API to ...
0
votes
0answers
52 views
Using polymorphic objects to represent parts of a deconstructed sentence
I am trying to make a chatbot using javascript by deconstructing a sentence into its intent by separating the Noun's Verb's, Adjectives, Durations's, Numbers etc... to construct a data query to try to ...
2
votes
1answer
36 views
Immutable ES7 global state store
I am quite an experienced developer but I am quite new to JS/frontend/functional programming and I am working with react-native in my day-job now.
I'm trying to do my own flux implementation to ...
2
votes
1answer
32 views
Clipboard support in jQuery using revealing module pattern
I have recently been getting into the habit of leveraging the revealing module pattern for all my code. I used this guide for inspiration, but my code doesn't feel as elegant.
...
1
vote
1answer
21 views
Using Bluebird with fs to read a file within each of an (variable length) array of directories
I'm reading an array (of unknown length) of modules package.json files in order to extract the "style" property and store it in an array of its own:
...
2
votes
0answers
88 views
jQuery plugin to highlight HTML on click/hover events and easy grouping
I have this plugin that I have finally finished the big pieces of, there's one or two minor details that are not yet implemented do to lack of a decision yet but everything else is there.
I wrote it ...
0
votes
0answers
25 views
jQuery slideshow with connected links and the ability to pause/resume when hovered - follow-up
The stated goal from Take 1:
I want a slideshow with three primary pieces of functionality:
Has text links that act as bullet-points and can jump directly to a slide when clicked.
Pauses ...
4
votes
2answers
58 views
Basic JavaScript ToDo list with task priorities
For the sake of training my vanilla JS skills I've decided to make a simple ToDo list with the following features:
Tasks can be added with a priority (higher the number - higher on the list)
...
3
votes
1answer
44 views
My Basic Tax Calculator
The goal is:
I can add many services as I need.
I can add many taxes as I need (the idea is that services has all of this taxes)
Calculate per services each tax value
Sum all the taxes of each ...
1
vote
0answers
7 views
WebRTC screen recording plugin performance testing
I am building a screen recorder extension for Google Chrome, it works as expected but I am deeply considered about the performance since it chucks data collected through screen sharing and microphone. ...
1
vote
2answers
47 views
Find unique range numbers
im using the following code which is working.
The code provide range of random values but unique one i.e. it doesn't return the same values until the full range was provided ,what do you think and ...
4
votes
1answer
36 views
jQuery responsive tabs to accordion
I wrote a script that adapts HTML tabs for different screen resolutions. On a small screen it's an Accordion and on wider ones they're Tabs. The script is for a production site, and I'm not so good in ...
3
votes
1answer
55 views
jQuery slideshow with connected links and the ability to pause/resume when hovered
Update: Here is Take 2.
I want a slideshow with three primary pieces of functionality:
Has text links that act as bullet-points and can jump directly to a slide when clicked.
Pauses when a slide or ...
1
vote
1answer
92 views
Advent of Code Day 1 - “No Time for a Taxicab”
Advent of Code is a fun competition. Here is a link to the first day. Each day has two parts.
--- Day 1: No Time for a Taxicab ---
Santa's sleigh uses a very high-precision clock to guide its
...
0
votes
0answers
20 views
Update document if it exists otherwise create a new document - Mongoose
As the question states when the user submits a form mongoose checks whether the document for that user already exists, if yes then pushes an object into the array. If it does not exist then it creates ...
0
votes
0answers
21 views
Redirecting user to another page if certain condition is met [closed]
On Page#1, I am writing a code in JavaScript to check if the user has certain properties or not, if not, I want to redirect the user to page#2. So I wrote code to check the user status, and redirect ...
1
vote
0answers
19 views
jQuery slider plugin
I'm pretty new to jQuery and JS, recently tried turning a working slider into a plugin for the first time for a small project. I would love some feedback, code improvement, optimization and any do's/...
-3
votes
0answers
27 views
Pseudoternary encoding using javascript [closed]
I am trying to write with javascript the procedure how the Pseudoternary encoding works.
(when it is 1 It's always in the middle. Otherwise when it is 0 it firstly goes up, then down , and again up ...
2
votes
1answer
34 views
Count the number of biggest numbers on the board
I coded two answers to this challenge. The first one was a standard attempt, but after it timed out, I figured out the "trick" to solving the problem much more simply. However, I'd still appreciate ...
4
votes
2answers
85 views
Find the election winner
Challenge
There are n citizens voting in this year's HackLand election. Each voter writes the name of their chosen candidate on a ballot and places it in a ballot box.
The candidate with the ...
2
votes
0answers
16 views
Storing products in MongoDB with support for sorting by their number of followers
I'm loading products via an infinite scroll in chunks of 12 at a time.
At times, I may want to sort these by how many followers they have.
Below is how I'm tracking how many followers each product ...
1
vote
1answer
19 views
Control element with JavaScript & Sass: Move options between two select-elements
Who has to use enterprise software like for example Microsoft Access knows that control: There a two select lists. The one list offers possible options. With a button you can add one or multiple ...
0
votes
0answers
11 views
Create a nested array JSON in Vue.js (using v-model ) [closed]
I am new Vue.js, I am working invoice project using Vue.js. I want out put like this, output:
...
2
votes
1answer
22 views
JS micro-view library
I created a JS view micro-library not too long ago it's named contours. Its primary purpose is element creation. It has some similarities to ReactJS. It lacks many features that React has like server ...
-1
votes
0answers
5 views
How To Response To telegram bot Webhook Request? Same Request Are Coming Repeatedly [closed]
I am trying to make a telegram bot(for learning purpose) with nodejs using official telegram bot api. I set a webhook to heroku.
I am able to reply the request but after some time the same request ...
1
vote
0answers
13 views
Higher order component for verifying authentication
I am new to React.js. On the server side, I am using Passport.js for social authentication setting a cookie. With that cookie I am verifying on the client side with a higher order component (HOC). ...
3
votes
0answers
22 views
YouTube component of a multi-component web-app
Following is basic JS code to create a YouTube search bar, search of query and load the results in a dropdown menu.
I am new to JS programming and I am seeking advice for how to write better code.
...
4
votes
0answers
82 views
Accessing a REST WebService and updating local HTML objects with Modular JS
I have this code I am doing to make my code modular js:
...
0
votes
0answers
14 views
Binding an event to parent or child [closed]
I am binding an event in code to a list item, so my code looks like this:
var list = $("ul#mylist");
list.on("click","li.myItem",function(){
});
so I am binding ...
4
votes
2answers
29 views
how to properly expose an ES class function residing inside a module?
I have a little class for loading a config file:
...
3
votes
0answers
9 views
Promises in mongoose
I've implemented a promises in mongoose to reduce the amount of callback hell but I am not sure whether my technique is correct.
The scenario:
Before I can save my schema I want to run some ...
1
vote
1answer
24 views
Swap the names/properties in a JavaScript object
Is there a more elegant way to do this in JavaScript?
...
0
votes
0answers
18 views
How to correct click in treeview menu? [closed]
Hi i need to create treeview menu, actually i created it. i want to made simple changes.
follwing code
Html version
...
-4
votes
0answers
18 views
Refactoring nested conditionals [closed]
I quite often come up with the code that looks like this
...
3
votes
1answer
37 views
Getting JSON with jQuery, creating a function that displays the data from two separate feeds
I have written my first JavaScript program from scratch and am looking for advice to check whether it is efficient and effective or how it could be improved.
The following is my code:
...
1
vote
1answer
24 views
How to make my javascript more efficient [duplicate]
I have written my first javascript file from scratch and am looking for advice to check it is efficient and effective or how it could be improved.
The following is my code
...
-3
votes
1answer
36 views
JavaScript table not showing [closed]
I'm practicing this question where I'm supposed to make a table programatically and although I'm not getting any errors the table is not showing.
...
1
vote
0answers
22 views
Coffee for tooltip with images [closed]
i have an coffee script for creating tooltip and it look like so unacceptable. How can I refactor it?
...
3
votes
1answer
25 views
Single Validation function, called once per Animation function
Just looking for a way to include a single validation function inside of another function, that will stop any other lines from executing if it fails.
NOT an if statement... I'm trying to avoid ...