JavaScript is the original and common name applied towards most flavors of a scripting language that originated on NetScape Navigator. Use this tag for questions regarding common implementations of ECMAScript, JavaScript, JScript, etc. JS does not typically refer to its ECMA-cousin, ActionScript.

learn more… | top users | synonyms (1)

-6
votes
0answers
21 views

Why my alert message for “Baki bonus anda tidak mencukupi” did not appear? [on hold]

Why my alert message for "Baki bonus anda tidak mencukupi" did not appear? using System; using System.Collections; using System.Configuration; using System.Data; using System.Data.SqlClient; using ...
0
votes
1answer
19 views

What is the approach for implementing FLUX in a CRUD application that pulls JSON data from the server?

While using FLUX in a CRUD application, according to what I understood, initially the data is returned from an AJAX call and then stored in the STORE. So, all the data that is currently viewed is only ...
-1
votes
0answers
35 views

How to view changes without changing the file name? [on hold]

Am in a process of learning website developing but i have encountered a problem, i cant view changes done in my sublime text without changing the file name.what do i need to do to view changes when ...
-5
votes
0answers
23 views

JavaScript functions problem [on hold]

<! DOCTYPE html> <Html> <Head>   <Meta charset = "UTF-8" />   <Title> surface Kvadra </ title> </ Head> <Body>     <H1> surface cuboid </ ...
-4
votes
0answers
16 views

MVC Related problem and Javascript [on hold]

I have form in asp.net MVC 4 in which one html table is binding based on some condition. In HTML Table there is textbox in every row in one column. Now I want when I enter some value in textbox in ...
-6
votes
0answers
34 views

Need advise on javascript and php [on hold]

I know this is off topic question and you may voted down. But i really need your advise on JavaScript JQuery and PHP. I always see this type of ads Need full stack developer on famous job sites. I'm ...
-3
votes
0answers
18 views

adding menu and sub menus in context menu using javascript and ajax [on hold]

I want to add menus and submenus with link in context menu using javascript and ajax. If any solutions please share
1
vote
0answers
81 views

Approach for developing code generator in JavaScript [on hold]

I have a requirement to develop a code generator which generates CRUD node applications based on a JSON specification. The JSON specification will have meta data such as Domain Objects, Relationship ...
-2
votes
1answer
106 views
+50

Showing a “context”-like menu in a span

Context of the question (some people believe it is useless to give such details, so feel free to skip them) It is about the MELT monitor (an alpha-stage GPLv3 free software, see also here). FWIW, I ...
-3
votes
1answer
88 views

URL links in Javascript frameworks

I am trying to sell to my client a javascript framework to replace a server generated website, but am having a hard time selling it because of URLs. My client would like to be able to have copiable ...
1
vote
1answer
153 views

Any reason to continue using plain strings in ES2015?

My current coding style is to use single-quoted strings as a default, and use backticked template literals whenever I need to concatenate a value into a string. But I'm now wondering what's the point ...
2
votes
1answer
76 views

Respectable design pattern for making node modules flexible/testable?

I am looking to get some input from some more experienced testers than what I am. :) I am trying to make my node modules testable, allowing for dependency spying/stubbing/mocking without the need to ...
1
vote
0answers
52 views

Suggestions for Storing large collection of related words

I am trying to create a simple sentence generator that uses templates and a database of words. It will be a website where essentially a user could click a button to generate a sentence. For example: ...
0
votes
3answers
75 views

Is synchronously inspecting a promise an anti-pattern?

ES6 native promises do not allow you to synchronously check if they're resolved/pending/failed or to extract their value. I sometimes need this functionality and thus I have to code it manually. Is ...
1
vote
1answer
43 views

Is there any value in using a Promises library versus ES6 Promises?

I see a lot of NodeJS articles recommending the Bluebird library for promisifying your code and avoiding callback spaghetti. Is there any value in using such a library when using Node 4.2.4+ given ...
4
votes
2answers
98 views

Is Module Pattern in JavaScript is useful only for singleton creation?

Some articles (JavaScript Module Pattern In Depth, Mastering The Module Pattern) describe defining modules in JavaScript like in the snippet below (from Addy Osmani's "Learning JavaScript Design ...
0
votes
3answers
133 views

How far should I validate user input in my own created API?

I got something here that bogs my mind a bit. Let's say I write me this API (in TS), check out some of these properties: export class MyAPI{ ...
-4
votes
0answers
20 views

Database Structure for Agents commission payouts generation with TDS deduction [closed]

Actually I am creating this for the first time to generate the commission payouts for agents for their sale. Commission need to be generated when the product is sold out and payout need to be done ...
3
votes
1answer
213 views

What is a Web API?

I am doing some reading on web technologies on the MDN page. I understand how HTML, CSS, and Javascript can be used to build websites. However, I am a little confused about Web APIs. Are Web APIs a ...
-2
votes
1answer
42 views

Javascript: Effect of passing entire object vs a property of the object as argument on performance

Does passing the entire object as argument rather than just a property of it, in javascript, effect performance? For example: <input type="button" onclick="getDetails(this)"/> vs <input ...
5
votes
3answers
893 views

Is break a code smell?

I'm asking in terms of a loop, obviously break is important in switch statements. Whether or not switch statements themselves are code smells is a separate issue. So consider the following use cases ...
0
votes
4answers
165 views

How does this function returning a function work?

I'm having a hard time understanding exactly what is happening in the code here and how this script is changing other functions. This is taken from eloquentjavascript.net chapter 5 on higher order ...
0
votes
1answer
109 views

JavaScript & AngularJs Modules Implementation technique and structure

So Im building an app and I'm trying to implement the structure of the app so that its robust and scalable in future. My app is mostly divided into JavaScript Modules (revealing pattern): // ...
0
votes
0answers
29 views

How to get dual UI for an ionic app?

I would like to get some suggestions for building a new app. This app has two faces/UI to it, buyer/seller. Users would have same account, and it would be seller and buyer. Its something similar to ...
-2
votes
0answers
68 views

Using Javascript popups to create a workflow for legal experts writing and editing legislation [migrated]

I suppose this is a ui-flow question. I'm currently working on a project where a couple of the stakeholders are suggesting the use of popup windows, i.e. browser tabs, to create a workflow to ...
6
votes
4answers
432 views

in dynamic language like javascript how do you know what the argument is?

In Java or Scala if I have an argument configuration: Conf, I can look for Conf class/trait/case class and see its construct so I know which arguments to pass. Recently I started dealing with ...
0
votes
1answer
124 views

Consuming REST services: client or server

I am working on a new project in which we are currently deciding which technologies and frameworks we will be using. The application will eventually be cross platform. Therefore, for the server side, ...
1
vote
1answer
80 views

Javascript and HTML decoupling

Based on the following snippet HTML <table id="example" class="display" cellspacing="0" width="100%"> <thead> <tr> <th>Name</th> <th>Position</th> ...
1
vote
1answer
65 views

REST Standard for changing SPA Model after fetched from REST API

Let's imagine. I have following data from database. ====================================== id | Title | parentId ====================================== 100 Asia NULL ...
5
votes
2answers
166 views

Idiomatic way to write JavaScript class that maintains state and tells you when that state has changed

I am an experienced C++ developer but new to JavaScript. I want to write an ES6 JavaScript class that maintains state. How do I tell when state has changed? I can think of two ways to do this. One ...
-1
votes
1answer
79 views

Javascript Closures to Separate Class [closed]

PROBLEM: In Javascript I use closures to encapsulated methods inside a class. It helps building hierarchy inside and minimize amount of methods at root, but they become lengthy. RESEARCH: Applied to ...
2
votes
1answer
45 views

A JavaScript IIFE prevents leaks to the global space as a closure? Is that the correct concept?

I see in the code or sometimes people talk about it, for some JavaScript code: (function() { var something; function someFunction() { // some code here } // do something ...
-2
votes
1answer
201 views

Functional programming, and pushing item to array [closed]

I'm studying functional programming and I'm having some question concerning array population. Actually, I'm trying to rebuild the Array.prototype.map function, and here's what I've got: ...
3
votes
1answer
69 views

In SPA what happens in terms of memory and performance when user hops across all the pages?

Imagine a humongous web aplication built using Single Page Application framework such as AngularJS. With its each route it downloads a couple of HTML template files. Each of these template files ...
3
votes
1answer
82 views

Client Side Filtering or Server Side Filtering

So I am building a web-app. The app will be hosted on heroku and I using a MEAN Stack for development. The main purpose of the app is to allow users to search through data and be able to find a ...
3
votes
1answer
92 views

JavaScript functional conversion from flat list to tree

I've been going through the RxJS tutorials http://reactivex.io/learnrx/. Almost all of the exercises involve moving from a hierarchical structure to a flat structure so I thought I'd try to do the ...
0
votes
1answer
170 views

Confusion over Node as a “script” vs Node as a “server”

As I was beginning to tool around a bit with node, I was told that I needed to undergo a little bit of a paradigm shift since I was coming from a PHP background. I would ask questions like, "I have my ...
1
vote
1answer
103 views

Suggestions for structuring complex json structures?

I can't find many tips for how to design complex json structures beyond the obvious tips of not trying to nest too deeply, using defined data types, etc. For example, if I have a location that needs ...
2
votes
1answer
107 views

Should constant values be in SHOUT_CASE when there is language support for them?

Referring primarily to here, it suggests that values which are constant in JavaScript (using the keyword const) should be named in SHOUT_CASE. I'm of the opinion though that mutability is much more ...
2
votes
1answer
46 views

Convention to where to declare module.exports on Javascript files

Is there any convention to where we should declare the module.exports no Javascript/Node.js module files? Should it be in the beginning of the file like: module.exports = Foo; function Foo() { ...
0
votes
1answer
98 views

When to use “is a” or “has a”? [closed]

In my node.js application, I have a queue class which has push and pop methods and a data property. I have an Event class which handles an event and pushes it on to the queue. If I think object ...
1
vote
1answer
131 views

Javascript Closure Style Similar to Java Class Structure

PROBLEM: There is a coding imperative (S. McConnel, Code Complete) that one shouldn't code on language, but by means of it, e.g. doing right style things even if language doesn't have some ...
2
votes
1answer
82 views

How to handle a client app that connects to a TCP server and sends/receives text data bidirectionally?

I've got a conceptual question (which is probably better posted here than on StackOverflow?). I want to develop a client application that maintains a persistent connection to a server, and exchanges ...
0
votes
1answer
92 views

Handling multiple asynchronous events - Wait for pending offers to process on new offer?

I have a programming problem, that I don't know how to solve. And while I have provided a sample of my code, I am interested in a conceptual answer on how to resolve this problem. On a tradeOffers ...
3
votes
1answer
125 views

Filtering request and responses in RESTful MEAN stack

I have a very basic RESTful service written using the MEAN stack (MongoDb, Express.js, Angular.js, Node.js) and utilizing the Mongoose ODM. Product schema var productSchema = new mongoose.Schema({ ...
2
votes
1answer
47 views

Should I be returning promises from any function that uses them?

Promises is a fairly new pattern for me, so I'm still building my intuition for them. I recently came across a case where some code in an adapter-like bit of code was once synchronous, and then ...
-4
votes
1answer
127 views

different between ES6 and Javascript [closed]

What is ES6? Is it JavaScript? Or multiple language supporter? I searched for it but can't understand it, especially the page on Wikipedia. Is it better than Javascript? And what can I do in my web ...
3
votes
1answer
95 views

Javascript Promise chaining [closed]

I recently started working with JS Promises. What I always like to do, is create function, which returns a Promise with the final desired result, but I only do 1 operation/then. Consider something ...
0
votes
0answers
58 views

AngularJS and NodeJS required version

I am new to the world of Javascript and their frameworks, and I feel a bit lost with this. I am trying to follow the official toutorial of AngularJS. In one of the first sections, it reads Install ...
-5
votes
2answers
87 views

Technology like SignalR but client side [closed]

I would like to program a software that will heavily utilize client side development (JavaScript), and I want to communicate with the server. Is there a way similar to SignalR where I can keep ...