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)

0
votes
1answer
78 views

Business logic - Server side vs client side

In my current project I have a screen which pulls data from several webservices, pulls data from db via backend api and checks that all resources have the same data. The other webservices are partial ...
96
votes
5answers
14k views

Is there any reason to use the “var” keyword in ES6?

Babel's guide to ES6 says: let is the new var. Apparently the only difference is that var gets scoped to the current function, while let gets scoped to the current block. There are some good ...
-2
votes
0answers
23 views

Redis connection failing [migrated]

So I have node app docker containers running, and they run fine, but I noticed over the course of 1-2 months all of my apps begun having errors with redis, seems like the connection is not making it / ...
-1
votes
0answers
21 views

Shuffling of MCQ's in my examination portal

the screen shots attached are structure of database of my exam portal, one picture represents the question bank and second represents the test details.Test ID is acting as a primary and foreign key. ...
0
votes
0answers
36 views

JavaScript coding and project organizing conventions

Recently, I've started working with JavaScript projects closely and with my C# background I am already wondering about some conventions. I see a lot of source files that use dots to separate words (i....
0
votes
1answer
54 views

Manipulating DOM via script or rebuild website - which is better?

Let's assume you want to change what user sees on the website. There are two ways to do that: a) manipulate the DOM via JavaScript, but user has to download whole script, with possibility he may not ...
-1
votes
1answer
146 views

How does jQuery work?

What exactly happens underneath (I know it changes the paragraph tag's HTML when the circular div is clicked) when I run this piece of code? Could you please explain the callback function as well. &...
-2
votes
0answers
38 views

Is it possible get JS function? [on hold]

I think that when JS developer had create JavaScript, they have create some function like log(), write(), alert(). They had do something like function alert() {} and then standard it (I imagine). So, ...
1
vote
1answer
153 views

Put code on client (JS) or server (C#)

In an ASP.NET app, I've got to decide whether to put a complex piece of code on either the client in JS or on the server in C#. I've considered performance (if on server, it would be a small ...
2
votes
0answers
111 views

What is a good way for a child to learn programming? [closed]

I learned to programme in Basic in the 80s, aged 7, on a BBC microcomputer. That computer was a good environment in which to learn - it was made with the specific intention of making programming easy....
-1
votes
0answers
35 views

Service in Angular not successfully returning variables [on hold]

I wrote a service to perform the $http.get calls and return the necessary variables that I needed for the functionality of my template. The issue I'm having is even though I'm able to see and log the ...
2
votes
1answer
101 views

Are promises functional

Functional programming is often explained to agree with lazy evaluation. As far as I know lazy evaluation means that a method gets called if the evaluator/browser/etc. thinks that is the next best ...
-1
votes
0answers
50 views

Writing efficient JS for website

Just a question really about best practice and to get a better insight in how to code in a more efficient manner. Currently when working on a website I'll have my custom.js file that usually looks ...
1
vote
3answers
716 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 ...
1
vote
5answers
2k views

ASP vs javascript vs jQuery vs User Controls vs AJAX

Increasingly when developing sites I find myself utilising more client side technologies such as Javascript, jQuery and AJAX. For three different pages I measured the size of the HTML sent to the ...
0
votes
0answers
52 views

Pointers on porting a c++ workflow domain specific language to javascript

I am writing a game in c++ with the v8 javascript engine embedded in it. I have a c++ workflow system I use to tell things how to do specific things. It's nice and I like it, but I need it to work ...
3
votes
3answers
97 views

Ways to structure a program with 2 states

I'm working on some sort of a Level Editor but I'm not quite sure how I want to handle the two different states: The Editor state and the Player state. In this first state game elements can be moved ...
1
vote
0answers
36 views

Concept: Create rotating 3D Card

I have images of the two sides of a postcard, front and back. I'd like to create a little image view tool that creates a 3D postcard using the front/back images and have the user be able to rotate the ...
-3
votes
0answers
87 views

How to build a pixel grid like the one use in the million dollar billboard project? [closed]

I want to build a pixel grid system, that I can control the size of each block they way I want it. Also the user will be able to upload his image, link and title to each block/ blocks he chooses ( I ...
0
votes
1answer
153 views

Recently moved from java to javascript on nodejs, how to maintain code? Help!

I recently moved from java to javascript on nodejs. I was very excited, opened up my intellji IDE for an existing nodejs project only to find I cannot know what the parameters I see functions ...
0
votes
0answers
22 views

Do you inject everything explicitly used in a module even if it is loaded in a “parent” module?

When you build a app modularized what do you inject into submodules? Only those things that are used there but not added at the top level, or do you inject everything that is explicitly used in that ...
0
votes
0answers
47 views

Converting dynamic webpage into static

I am working on a project in which I need to take a dynamic website like adobe spark - https://spark.adobe.com/gallery/gallery-editors-choice/example/maggie-to-monte/ and create a static html+css page ...
0
votes
0answers
30 views

Why doesn't Object.prototype.toString produce more meaningful output?

Why doesn't Object.prototype.toString return a string representation of an object? I don't see any use for the current output and it seems that it would be more useful for the toString function to be ...
7
votes
3answers
919 views

Have they missunderstood currying or have I?

This question is similar to the question posted on Does groovy call partial application 'currying'?, but not completely the same, and the answers given there do not really satisfy me. I would ...
-1
votes
0answers
64 views

Is there any function to convert value to number format in JavaScript? [migrated]

Is there function to convert a value to number format in JavaScript? Ex: 10006.1056 to 10,006.16
0
votes
0answers
42 views

What is the better way to call the bind function in this case?

I am using es6 and babel. I have a class which serves as a in-memory data cache (DataStore). It has an API function called findByIndex. I can retrieve data by using an index name and related ...
5
votes
4answers
1k views

What's the best approach to develop a cross-browser JavaScript app?

As one of my summer projects I'd like to build an AJAX program on my own. Not too big. I'm new to the whole matter, however I have general knowledge in programming and a good understanding of the Web ...
-3
votes
1answer
84 views

How to incoporate jQuery UI into ASP.NET MVC 5 project that is on an offline system? [closed]

I am having some issues trying to incorporate jQuery UI into my project. I cannot use Nuget or anything else that goes to the internet, so I have downloaded the development package from the jQuery UI ...
0
votes
0answers
23 views

search library for internationalization

I use jquery and I would like to know if it is possible to put a tag in an html file and the text in this tag will take the value from a file? like <li id="report" role="presentation" data-toggle=...
4
votes
1answer
641 views

Client side authentication through signatures instead of passwords

I want to save some user-generated data with some signature of the user that generated it (let's say that the user has to fill some forms with some data and I want him to sign the written data). The ...
1
vote
1answer
77 views

The advantages of a static blog generator with dynamic content

This is a design question. I am building a mathematically oriented blog, where I can discuss various areas of statistics. Now with math comes the importance of visualization--in particular interactive ...
9
votes
2answers
310 views

What does it mean to inject data (vs behaviour) in a class constructor, and why is that considered bad practice?

I am reading the book "Learning TypeScript" by Remo Jansen. In one section the author describes how to create a very simple proof-of-concept MVC framework including how to create the Model class and ...
8
votes
6answers
561 views

Is it considered bad practice to run different JavaScript for IE

Is it considered bad practice (and how bad) to run different JavaScript for IE? Currently im writing some JavaScript and the simplist way to work arround IE quirks seems to be to check for browser ...
0
votes
0answers
26 views

validating arguments in javascript constructors

In many cases, it is useful to have a constructor or factory method that validates arguments before instantiating an object, returning a new object if the arguments are valid and null otherwise. But ...
1
vote
1answer
54 views

Using expressions instead of statements

In javascript you can't use statements in expressions. Because of this you are forced to use logic and ternary operators in an expression when you want to use if or switch etc.. Since I didn't want to ...
3
votes
1answer
114 views

Would a site like stack overflow be better as separate static builds or a single app with run-time switches for each community?

I'm designing a web application. I'd like to use sub-domains to split the site into logic separate sections based on some category - exactly like the stack exchange websites do. I'm currently aware of ...
2
votes
1answer
92 views

Programatically determine that some functions are pure

I saw this question that shows it is impossible to programatically determine if a javascript function is pure, but is it sometimes possible to affirm that a function is pure - so something like... ...
-1
votes
0answers
41 views

how do I replace a variable in a template string in Javascript? [migrated]

Here's what I'm trying to achieve. let something = 'first string'; let template = `asdf=${something}asdf`; some.method(template) .then(function() { let something = 'new string'; ...
1
vote
0answers
61 views

How do I write an API that makes use of many smaller APIs?

I have a solid set of classes that do the following build tables from data and templates advanced form serialization build forms from data and templates launch overlays with forms/wizards short poll ...
0
votes
1answer
69 views

One time use token Mobile / Desktop linking. How to?

I want to know if there's a way or known way to implement this: Lets say I have: a C# WinForms program a Javascript Mobile Application (Android / iOS) What I want to do is: for my C# ...
1
vote
1answer
73 views

How to display recent post on website and make own search engine ? With PHP

On OLX like Website , Anytime a user posts a new ad. It comes in top of the page. No search is involved in it. Which technology we can use to make such functions. Suppose X is visiting my website ...
0
votes
1answer
83 views

Developing a simple HTML exercises with JavaScript [closed]

I'm developing a website with some simple HTML exercises (like the ones in Codeschool and Codacademy), and now I'm stuck at the correction phase, how can I compare two HTML strings and decide if the ...
2
votes
3answers
198 views

Mapping different XML and CSV feeds

Not sure if this is the right venue to be asking this but here goes. A little background. I'm trying to build an ecommerce app that would allow sellers from other venues--like, amazon and newegg--to ...
5
votes
2answers
165 views

Set of specific values implementation vs. using some sort of generic set with advanced checks

I am working on a set implementation in JavaScript currently. This should kind of simulate generics as known from Java or C#. I need a mutable version of that (allows for adding/removing set values) ...