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
0answers
4 views

OEM/developer licences for javascript library dependencies

I'm building a JavaScript library which I'd like to provide very similarly to Highcharts (free for non-commercial only). The core functionalities of this library will have no dependencies (except ...
-6
votes
0answers
31 views

Need help on a daily basis [on hold]

The Valutazione(){} function doesn't work, could you help me please? <html> <head> <title>Questionario</title> <link rel="shortcut icon" ...
-1
votes
0answers
17 views

How to use Extjs with Spring

I'm so sorry if my question seems to be so simple, but i'm stuck i'm starting to work in a project involving Spring MVC, Extjs 5 and ExtDirect for binding, the guides of extjs recommends using Sencha ...
0
votes
3answers
128 views

URLs in javascript in the browser

We are trying to continually improve our source code base and a question came up recently which throws open a new area to improvement. Where best to put URLs that are needed in JavaScript? Do we put ...
4
votes
1answer
132 views

Why is the use of JavaScript in HREF attributes discouraged?

Disclaimer: I came to Programmers.SE to ask this question because I understand this is the place to ask this type of question, and not necessarily stackoverflow. If I am wrong, please close the ...
0
votes
0answers
4 views

How can I make this custom dual nav responsive and fixed at the same time? [migrated]

I have a client that want's two custom nav menus stacked on top of one another and under a slider with their logo in the center. They also want the menus to be fixed upon scroll. I have executed this ...
0
votes
2answers
57 views

What are the advantages of using async JavaScript modules (like AMD) for traditional sites?

This is specific to JS in the browser for a traditional multi-page site (i.e. not a single-page app). For single-page apps, the advantages are pretty clear: the main view page is going to be ...
2
votes
1answer
75 views

Callback functions: Semantics and maintainability, when they aren't necessary [duplicate]

Within the context of JavaScript/Node.JS; Will using Callback functions improve the maintainability of source code, when there is no need for async programming? For example does the plain code sound ...
-2
votes
0answers
37 views

How to change every 2nd and every 3rd element in an array? [on hold]

Here is my dilemma, I have this code: var fibs = [1, 2]; for (i = 0; i < (window.innerWidth / 50); i++) { if (fibs.length < 15) { var n = fibs[i] + fibs[i + 1]; ...
-3
votes
0answers
23 views

Regarding publishing game for Facebook [on hold]

I am making a game on cocos2d-JS for facebook , I have some technical doubt which I want to clear What is the difference between Facebook Canvas & Facebook Web project . Facebook Canvas ask ...
-2
votes
0answers
40 views

Beginner HTML5 path/to/jsFile. Unable to load script? [migrated]

I'm having some trouble running some JS inside a html5 body. Here's what's happening, whenever I remove all instances of the arrays from the JS file I am using, the script loads fine in the index ...
-2
votes
0answers
24 views

What are some websites that use ASM.JS? [closed]

Are there any websites out there using ASM.JS? PLEASE do not include websites that primarily have the use of WebGL or any game websites.
0
votes
0answers
31 views

Managing Login Authentication/Webpage session: Can client side javascript/JQuery access either a session variable or json variable in html?

Short version: A variable is stored in a session variable req.session.userName and also in the json sent with res.render('/', {username: value}). How can I access either of those variables from inside ...
-2
votes
0answers
57 views

How to improve programing skills? [closed]

I do a apprentertice. I program with javascript. I have programming for 6 weeks in the company. But I worry about my programming logic. I want to improve my programming logic. I should sort a Array ...
1
vote
1answer
45 views

How to introduce Google Analytics code in a modular way?

We are working on a very large codebase. It's basically a web-based operating system, with its own file system and applications. The system's UIs are generated dynamically with Javascript. We've ...
-2
votes
0answers
32 views

JavaScript interpreters? [closed]

Okay so I have just started learning JavaScript less than a week ago and I love it. I have never done any kind of programing before. I have been using code academy for some lessons and I am ready to ...
0
votes
0answers
54 views

Naming self or this something else, a good idea?

I'm finding that my code becomes more readable when I make a local reference to this/self, and/or call it something that makes sense in the context. "self" or "this" doesn't really indicate what kind ...
0
votes
1answer
109 views

Programming CPU Emulator Functional Style [on hold]

I want to write an 8086 CPU emulator in javascript, functional style. How would one conceptualise / design an 8086 emulator, or any CPU emulator that has registers and realmode memory access in a ...
-2
votes
0answers
22 views

Not getting value in second cycle of when returning to form 1 from form 4 in java project [closed]

I am working on a java project, where i had created 4 jsp forms. On first form i had a select box. I select a value from option. Then I go to form 2,3 and 4,here the selected value is disabled. From ...
0
votes
1answer
60 views

Why do browser Javascript libraries pass the window object as an argument?

While looking at various JavaScript libraries, I have noticed a relatively common practice of passing either the window or the document object as part of the arguments given to the library ...
0
votes
0answers
29 views

Get element constraint [migrated]

I've been working recently with very nested HTML elements. Sometimes, an element's size is constrained by a parent element several levels up, or more. Finding the constraint can be tough. An example ...
3
votes
2answers
2k views

Every function is a closure?

Wikipedia says, that closure - is a function, which has an access to variables, declared outside of the function. There is even an example: function startAt(x) function incrementBy(y) ...
-4
votes
0answers
51 views

What is the most minimal web app stack for a server? [closed]

The situation I have is that I am developing an web app for a company that has a really old Windows hosting environment. It's not an official app for the company, more of a pet project where I'm doing ...
-1
votes
1answer
46 views

Detect touch sizes on screen

Is it something possible to detect touch boundaries on a screen? My real question is relative to Javascript and Touch Events, but even speaking of common software (a regular application rather than a ...
1
vote
0answers
72 views

Can/should objects share methods in certain circumstances?

I am currently working on a web application that is supposed to resemble an operating system with GUI (it manages processes and windows). I have several constructors which deal with different aspects ...
-3
votes
0answers
11 views

how to display database with javascript in the form of a table? [migrated]

I have problems with my application that is when it will display the data from the database in the form of a data table that happen to two sideways instead of down main.js ...
-1
votes
0answers
24 views

Javascript component (de)composition [duplicate]

I am currently in the process of building a distributed application, containing mobile devices, a backend/server and webclients with javascript, using MQTT as event bus. When researching the ...
3
votes
1answer
109 views

Functional programming pattern for async JavaScript code

I have adopted a pattern in one of my projects that I really like and I suspect it's likely to be something standard. I'd like to describe it here and see if you guys can tell me how other ...
-1
votes
0answers
16 views

Chrome Console on android [migrated]

Is it possible to open chrome browser console with an Android? (Like S4) is it possible to do so with Java? I tried going into the settings and such, but is it possible to access the console and ...
0
votes
2answers
70 views

memory needed to store a function in javascript

I have been using sizeof.js to investigate the size of various objects in javascript. It appears from this that the size of a function is essentially zero bytes, regardless of how many instructions ...
-1
votes
0answers
32 views

Problem with node.js and server.js [migrated]

I'm a bit stuck right now, and hoping someone can shed some light. I'm relatively new to sockets in general, but have been programming in javascript on and off for several years, although only about ...
1
vote
1answer
55 views

How to debug minified javascript on production? [closed]

I have a front end single page app deployed on S3. It is minified on production. It creates error only when it is minified via grunt on production. I cannot repro the issue in dev. How do I go about ...
2
votes
3answers
169 views

Which of these is the better way to structure functions in JavaScript?

I am new to programming (self teaching Javascript so I am missing some of the basics). I'm not sure if this falls under a style or best-practice question. When writing a function that will be used ...
1
vote
1answer
95 views

Should I use composition or inheritance for sharing configuration items?

I'm working on a fairly new project where I'd like to share some config items used by a JavaScript plugin. Specifically, the project is using jQuery dataTables and I want to find a good way of sharing ...
2
votes
1answer
93 views

How to detect subtle changes in a website?

My friend and I were discussing a script for automating a certain task and the solution involved using Selenium to automate the pressing of certain buttons. However when we click the send button of ...
1
vote
0answers
96 views

Distributed vs Centralised configuration

We're building an app based on Flux/React - and we're trying to establish a scalable pattern for configuring routes and registering dependencies. The two approaches we have can be broadly categorised ...
-4
votes
1answer
48 views

Languages for gaming website [closed]

So I'm a 15 year old trying to teach myself how to code because I'm deeply interested in it. I would like to one day be able to have my own games website, with little games I'd write. I have a little ...
1
vote
0answers
117 views

Better to keep JScript.NET dll or try converting JScript.NET code to C#? [closed]

Let me explain the back-story to my question: I have made a .NET program that logs into an account on a website and scrapes various pages of information. In order to login to the website, I must ...
16
votes
1answer
5k views

Is vanilla JS still considered a library?

I very recently found out that VanillaJS (document?) is a library that's just bundled with 99% browsers and isn't exactly native JavaScript (shock of my life). While writing a lib of my own I normally ...
-3
votes
0answers
29 views

How do you tidy up and maintain your code in JavaScript (jQuery)? [duplicate]

How do you tidy up and maintain your code in JavaScript (jQuery) while keeping it simple? I've been wanting to ask this for a while now but I never get around to it so I usually use websites like ...
1
vote
3answers
135 views

negative boolean expressions and eager boolean OR

I come across these kinds of expressions and I have hard time reading it. How do you read it properly to see if it is the right logic when debugging. if (!(userLoggedIn || isAdmin)) { ...
1
vote
2answers
157 views

How-To: a browser based, real time, shared memory inspection/debugger application [closed]

Background: I have a C application running under Linux utilizing shared memory. I also have a debugger written in Python that can link to said shared memory and access individual variable values of ...
1
vote
1answer
133 views

How to respond with error message when making AJAX calls

I have an app that wasn't written by myself. If there is an error such as an invalid ID given as a parameter, I would return something like: (200 code) { "success": 0, "error": "The row ...
1
vote
0answers
51 views

How to avoid module dependency chain nightmare caused by transitive dependencies?

Many (most?) AngularJS folks seem to advocate for breaking AngularJS apps up into many modules. Brian Ford in his blog already states that packaging by layer (controller, service, etc.) is a "silly" ...
4
votes
2answers
299 views

Practices for organizing JavaScript AMD imports

Our company has been using newer versions of the Dojo framework, which have progressed to an AMD-based loader format. I'm currently trying to find logical ways to separate layer files, taking a module ...
2
votes
4answers
131 views

Overwriting and returning the value of the argument used as conditional of an if statement, inside the same if statement

A simplified example: function logTheColor (color){ if(color == "red"){ color = "The color is red " } else if (color == "yellow") { color = "The color is yellow " } else { ...
-1
votes
1answer
90 views

Do you spend your effort to reuse obsolete unit tests or rewrite them entirely? [closed]

I have this javascript project which has a unit test suite(about 200unit tests) that covers about 11.31% of the code that it was testing. The project has evolved greatly but the unit tests where never ...
0
votes
1answer
177 views

Website with a lot of sound [closed]

I am building a website with a large amount of sounds that should be played upon clicking elements. (It is a language learning website, and many words and phrases will be clickable, to hear ...
-1
votes
1answer
134 views

Create fake HTTP server to simulate an API for testing

I'm looking to mock responses from an external API service that returns JSON during live events. The first response would contain (fake) events that have happened up to time X, the second response ...
4
votes
1answer
482 views

How dangerous is it to take shortcuts when coding Web based applications? [closed]

I started working as a Web developer few months back. Previously, I had no prior professional experience in programming besides school classes and fun-side projects I did on my own. I am the only ...