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)

1
vote
0answers
14 views

html/css/javascript for game ui's

I've been looking into game ui's recently. My conclusion is that html/css/javascript would be the perfect solution IF it was wrapped up in a nice C++ library that allowed for easy integration into ...
-5
votes
0answers
16 views

what could be a useful script for internet explorer setting? [on hold]

i was trying to find a way to edit some setting in IE like enabling and disabling active x setting and so on is there is any sort of script that i can use ?
-3
votes
0answers
60 views

Should I remove logging statements on production?

I have a bunch of console.log statements in my AngularJS app. Should those be removed for production? Are there potential issues from leaving them on?
-3
votes
0answers
13 views

Mvc manage context and reusable components

I'm trying to create for a Web App an MVC Architecture with a Hierarchical Router. The goal is manage all the business logic and views with a clear pattern. Let me do some example: Route index ...
-6
votes
0answers
51 views

Drawing shapes with JavaScript [on hold]

A javascript program. I don't want or can't use images. I want to represent countries. I'd like to know if there's somewhere a database, with countries shape coodinate, that you could use to draw ...
1
vote
1answer
104 views

Differences in design/thought process for OO in Java and JavaScript [duplicate]

Despite sharing a similar name and syntax, Java and JavaScript are quite different. However, they both have Object Oriented features. As a JavaScript novice, the main differences that I can see ...
-3
votes
2answers
114 views

JavaScript form validation without clicking submit button [on hold]

I want to validate a form using java script before user clicks the submit button. <form role="form"> <div class="form-group"> <label for="email">*Email ...
2
votes
1answer
73 views

How to design a serverside heartbeat with nodejs?

I would post this on http://stackoverflow.com/, but figured I am not looking for code, just an idea how to accomplish this. I have a gameserver that interacts with nodejs and uses the websocket ...
-5
votes
0answers
37 views

How to open Modal box after saving data to database and show result [on hold]

I need to open modal box for showing the error message or success result after uploading data from CSV in mysql . Please suggest me how can I made it possible ? $res = true //if no error $res = ...
-4
votes
0answers
67 views

Are there any serverside web languages like Javascript? [on hold]

Recently got into nodejs and absolutely love using Javascript for my gameserver. I've been working with PHP for years but.. I just find and love Javascript's object syntax and looping a lot easier. ...
-6
votes
1answer
38 views

How do you pass or fail performance tests? [closed]

If you need the tests to be consistent, define some failure criteria and measure. If you need the tests to be at least X fast (where X is ideally some metric gathered by usability testing) then do ...
0
votes
3answers
231 views

What arguments are there to use a coding style for each distinct language? [duplicate]

I recently had a discussion about our coding style for C# projects. Two things in particular were very hard to agree upon. Method Naming C# has the de-facto standard of naming (at least public, ...
0
votes
0answers
30 views

Trouble with a heightmap adjusting algorithm [migrated]

I have a 2D grid of integers. The user can pick any location and increase or decrease its number by one. The algorithm should adjust all eight adjacent locations so there is no more than a difference ...
-4
votes
0answers
23 views

Javascript Automatic Class Structuring Code [closed]

This is designed to make it easy to structure a large javascript project into its own independent classes/modules, then make those classes have easy access to their parent classes, all while keeping ...
0
votes
1answer
32 views

Bundling and minifying options for MVC2

I've just been handed an MVC2 application and noticed that there is no bundling or minifying of the JavaScript or Stylesheets. I've used the built in bundling and minifying logic that comes out the ...
0
votes
1answer
47 views

JSP in Javascript file or multiple AJAX requests

I've been thinking about how I want to load my data for some checkboxes in an AngularJS app. I'm generating multiple checkboxes based on 2 JSON objects that are currenty hard-coded in the a Javascript ...
0
votes
2answers
76 views

How to protect controller endpoint from abuse?

I am building a web app that will first validate a promotion code via AJAX call and then if it is valid, allow the user to fill out the rest of the form, I use KnockoutJS to reveal and hide the ...
7
votes
1answer
168 views

Why create a Global-ish Object.create function?

I'm a fairly experienced programmer in the .NET and Java realms, and I've started reading up on JavaScript. I bought Douglas Crockford's "The Good Parts" book, and I'm immediately put off by a few ...
0
votes
1answer
31 views

node deep file indexer module cannot go deep [closed]

I'm trying to make a file indexer by node.js. The program is supposed to index files and folders in an array and also check inside folders and add all sub folders and files I wrote: ...
2
votes
0answers
150 views

Javascript callback design: is it OK to have side effects?

Consider this javascript function: function(){ var someArr = [...]; var someObj = {...}; someArr.forEach(function(item){ if (matchItem(item)){ ...
0
votes
1answer
38 views

Is there any reason not to allow negative numbers to be entered into a JSP field labeled for positive numbers?

Our application, a fairly complicated money ledger, has a JSP field for entering a certain type of money due, balanced by payments made towards that amount due. In the application, this field is ...
2
votes
2answers
182 views

Pre-Processors vs Pure Web [closed]

It seems like within the last few years or so HTML/CSS/JavaScript Preprocessors have exploded in quantity and general use. They're still not as common as pure HTML, CSS, and JS/jQuery, but their ...
0
votes
1answer
128 views

Why sending a file is so difficult using angular? [closed]

I have to send a file (very large file) to a server. I'm studying what options I have and how to do it. I'm using angular + express + nodejs. If I use a simple form, I could catch the file on the ...
0
votes
0answers
116 views

Right way to design javascript flow?

My question is because I believe that maybe there is a better way to design my code when I need to do sync tasks in JS and wait for the response. I'm working on Node and I need to save some data (I ...
2
votes
1answer
49 views

Reuse already fetched data for request

I have action that fetches user model from db to check access. Then I have method that in some cases requires same model. function checkAccess(req, res, next) { var data = ...
4
votes
1answer
93 views

Nested classes via a getter (to emulate namespacing)

So, we all know that ES6's introduced syntax is definitely sugar over what we've been doing, previously. That being said, we still don't have namespaces (which would be nice...) The problem that I'm ...
1
vote
1answer
247 views

Why is it common to put an underscore before a method in JavaScript? [closed]

For example, I noticed that in the jQuery UI widget factory, methods like _init, _start, _on, ect.
3
votes
1answer
175 views

Is there any reason not to make a webapp be client-side only?

I recently started writing a path-finding algorithm simulation application in python. It takes user inputs, randomly generates a 2d graph, and shows displays the simulation via GUI. Now, what I ...
0
votes
0answers
60 views

“Python interpreter vs Javascript engine” memory model

I learnt that memory model of python interpreter is dictionaries of dictionaries, where each module is a dictionary. Let me elaborate more on this with an example, After i run >>> python ...
1
vote
1answer
65 views

React and simple UI state

I'm starting to playing around with React and have a basic question regarding state. I understand that in React state should only contain data which may change and cannot be computed from elsewhere, ...
1
vote
0answers
72 views

Were Java and Flash necessary pre-cursors to JavaScript and HTML5? [closed]

Java appeared in the Netscape browser in 1995, with Javascript and Flash very soon after (I think). Java and Flash allowed programmers to add rich interactions to otherwise static sites, which can now ...
0
votes
1answer
108 views

How do I design a Javascript Object to not use any public properties?

I have been playing with the Object creation outlined by Douglas Crockford in his new talk "The Better Parts" function constructor(spec){ var that = otherConstructor(spec), member, ...
1
vote
1answer
57 views

Keeping client side model and server side in sync in SPAs

Since SPAs have most of their domain logic client side, how do you keep your domain model in sync with the back end? For example, let's say I have a .NET WebAPI web service that uses the Entity ...
0
votes
1answer
147 views

How do I make a JavaScript promise return something other than a promise?

I have a spec from a client for an implementation of a method in a module: // getGenres(): // Returns a promise. When it resolves, it returns an array. If given an array of genres, ['comedy', ...
2
votes
1answer
68 views

In what case would indexedDB be useful [duplicate]

I have been over-viewing indexedDB recently, and I cannot seem to find a suitable use case that would not be better done using a server side database. Since the little hackathon competition I'm doing ...
-2
votes
1answer
110 views

How deeply can a JSON object be nested?

I was watching a video on a website that said json objects can be nested deeply. How far can a JSON object be nested before it will create an error?
0
votes
1answer
78 views

Trying to learn about core concepts in Javascript by making a web app, how can I do that without jumping to MVC frameworks? [closed]

For some reason I don't want to jump to a javascript MVC framework to make a web app for my portfolio. My main motive behind that is to learn in & outs of Javascript. What are my options if I want ...
1
vote
1answer
146 views

Correct usage of Bluebird promise

This is related to this question on promise performance. The current top answer states that using new Promise is an anti-pattern in bluebird And that promisify should be used instead. I ...
0
votes
1answer
69 views

Javascript inline event handling versus external jQuery event handlers

Working on a dynamic website that loads information from a JSON file and then populates the page with said elements. My question has to do with event handling - as of now, I don't see any reason as ...
0
votes
2answers
154 views

Is it OK to use Promises for Caching

Is it an acceptable (not surprising) to use promises to cache results? The idea is to generate a promise once, and just return that same promise again on subsequent calls. For example, a getAll() ...
9
votes
1answer
413 views

Why are native ES6 promises slower and more memory-intensive than bluebird?

In this benchmark, the suite takes 4 times longer to complete with ES6 promises compared to Bluebird promises, and uses 3.6 times as much memory. How can a JavaScript library be so much faster and ...
20
votes
2answers
2k views

How much should I be using 'let' vs 'const' in ES6?

I've been writing a lot of ES6 code for io.js recently. There isn't much code in the wild to learn from, so I feel like I'm defining my own conventions as I go. My question is about when to use const ...
7
votes
1answer
333 views

Language compiled to JS – most elegant way to do synchronous-style waits

I'm trying to make (yet another) language that compiles to JavaScript. One of the features I'd like to have is the ability to perform JavaScript's async operations synchronously (not exactly ...
0
votes
3answers
281 views

Is JavaScript fail-safe?

I was compiling a list of comparison of top 10 programming languages (JavaScript included). I was doing it from this Wikipedia page. However, in the third table (Failsafe I/O), there is no row for ...
1
vote
1answer
88 views

Multiple CS Sheets or Javascript

I have a homepage with a navigationBar on top of the Viewport contains two buttons. One is the default selected home button which calls/displays home.html. The other for example is Ubuntu which calls ...
0
votes
0answers
36 views

best/preferred way to create a “plugin” in JavaScript: “OOO” or array of each instance [duplicate]

I'm working on creating a "plugin" in JavaScript. I can't think of how to simplify my plugin's purpose so for the sake of simplicity let's say it is a table filter plugin. Either way the user would ...
1
vote
3answers
176 views

Avoid opt(options) in javascript [closed]

A lot of frameworks, most like jQuery plugins uses the "optional" parameter. Basically a dictionary (or key/value structure) with a bunch of additional parameters instead of send in the parameter's ...
1
vote
1answer
181 views

Best use of the React frontend framework

I've been using rails' erb template for my views, but I've recently been trying to incorporate React as my front end framework. I'm a little lost on how front end frameworks are supposed to be used. ...
3
votes
1answer
196 views

How can 'yield' be added as a keyword in ES6 if it wasn't a reserved word?

yield is not a reserved word in JavaScript, yet ES6 makes it a keyword. I thought the point of reserved words was for backwards compatibility. For example, let and const were reserved, so you ...
27
votes
6answers
4k views

Dynamic Code Evaluation in Java - Clever or Sloppy?

I am trying to create a flexible ACL framework in Java for my application. Many ACL frameworks are built on a whitelist of rules, where a rule is in the form of owner:action:resource. For example, ...