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)

-3
votes
0answers
43 views

How to protect a private REST API in an javascript web application

I'm building a web application. It's basically a blog. There is a javascript client web application and there is a server that implements REST API. When user visits my blog, I use javascript ...
2
votes
0answers
51 views

How do I create a modal service with AngularJS?

I'm trying to make a service that's polymorphic based upon what mode is specified in the URL. If the char param in the route is set to 'p', I want to use a PresentMode service. If the char param is ...
0
votes
0answers
18 views

Using the v3 api without autorized user need [on hold]

I wanna do a page for my website that can show a list of the last videos of 5 youtube channels (a mixed list) . It will be public so I need a upload_list.js script like this one : ...
0
votes
0answers
18 views

Breaking java script into manageable parts [migrated]

Hi I have long java script code with many functions and i want break it to manageable but struggling to get right design,Previously i have long init() and search function and now i want to break it so ...
0
votes
0answers
14 views

jQuery event binding management

Given the following elements: <div class="container"> <span class="some-class">content</span> ..n span repetitions.. </div> Given the following .on() ...
0
votes
1answer
34 views

MVC: Inserting a view from a SubController to its Parent controller

I have 2 controllers: 1 top level controller,MainController, and a SubController, which MainController has an instance of and controls. The SubController has a Subview which goes inside the MainView ...
3
votes
5answers
179 views

How do you unit test a function that clears properties?

I have a very common function that I have always unit tested in the same way, but I'm wondering if there is a better solution or if it's even possible a code smell is involved. It seems like a very ...
1
vote
1answer
116 views

The Better Parts and Delegation: Is Crockford Too Extreme?

Douglas Crockford has recently been giving a talk called The Better Parts. The gist of the talk is that JavaScript developers should actually avoid a superset of the The Bad Parts, which now includes ...
-3
votes
0answers
33 views

UI Developer Javascript Programming Responsibilities [closed]

What are the Main responsibilities for a UI Developer when it comes into JavaScript Programming/Development? What area in JavaScript s(he) has to concentrate? Whether s(he) need to be extreme solid in ...
3
votes
4answers
254 views

What programming mindset to have towards JavaScript? [duplicate]

I used to program in Java. As a result of that I got well-versed with Object Oriented Paradigm. In my opinion it is a great approach to programming because it's easy to unit test, use design patterns, ...
0
votes
0answers
98 views

If a webpage invokes a javascript function on a click from a browser, why can't I invoke it programatically? [closed]

So I'm a complete javascript and web development noob, and this question might be betray a fundamental lack of understanding somewhere. I'm on a webpage with a button that invokes a javascript ...
0
votes
0answers
18 views

Is having a parent controller to manage a set of tabbed sections an anti-pattern for an angular application?

A lot of times, I have long forms that I divide into multiple tabbed sections. Each section is managed by it's own controller and there is a parent controller that manages the whole view. I use ...
1
vote
1answer
72 views

AJAX - What exactly does that encompass?

So I see on a lot of people's resumes they list AJAX in their technologies (or programming languages - and I recognize that it is not a language). To me, AJAX seems like such a small concept to be ...
1
vote
1answer
20 views

Compose nested EventEmitters elegantly

I am developing a server-side JavaScript tool, and trying to do so in a modular way. I have a Parser class that is an EventEmitter - you call parse and it will eventually emit data and end events. It ...
0
votes
0answers
6 views

Insert Dynamic HTML content for Electronic Catalogue - Magazine [migrated]

I am making an electronic book(magazine). But i have 200 pages(in jpg format). So, in order to avoid writing the same line code for 200 pages i want to find out how to do it with javascript and php. ...
4
votes
1answer
104 views

(jQuery) What is wrong with methods such as .append?

tl;dr: What is wrong with the efficiency of methods such as .append() and what can be alternatives to this? Explanation: Hello everyone. I occasionally have to build A/B tests for websites, which ...
-2
votes
0answers
23 views

Javascript animation based on mouse click? [migrated]

So I'm attempting to make it such that when you click it creates a circle on the mouse's position, and on the second click, the circle moves towards the second click's location. So on and so forth. ...
0
votes
2answers
89 views

Porting an algorithm implementation licensed under GNU GPL v3

I'm working on a JavaScript port of a red-black tree implementation in Java from the book Algorithms 4th Edition, by Sedgewick and Wayne. I believe that my JavaScript port qualifies as a derivative ...
3
votes
3answers
183 views

Easy way to make old javascript files conform to new quoting standard?

We've just started putting linting in place at my workplace, and a lot of the devs didn't realize our standards called for double-quotes everywhere. About 50% of the codebase uses single-quotes, so ...
0
votes
0answers
49 views

Excel-like column numbering [migrated]

I have a working code (below) to convert a number to Excel-like (A...Z AA...AZ BA...BZ ...ZA-ZZ) column codes (headers). For simplicity I limited it to 1 or 2 character codes. My question is: ...
0
votes
0answers
4 views

Javascript code executing before its supposed to [migrated]

I have some javascript code that is being executed before it is supposed to be and I do not know why. Basically, I have a for loop that is supposed to be executed 50,000 times. However, this takes a ...
3
votes
1answer
79 views

What is the best way to format complex SQL queries in Node?

I am using node-mysql to query a MySQL database via Express and Node. My queries are getting fairly complex and I want to format them across multiple lines. However, the only way I could accomplish ...
1
vote
2answers
73 views

Running an HTML/JS/CSS only app on Android without external Phonegap/Cordova etc

Is it possible to run a small and simple game on android using only CSS/JS/HTML? E.g I have built a small game using the all too known 3 folder stucture and I was wondering if there is any easy way ...
8
votes
0answers
1k views

Do uncatchable exceptions exist in Javascript? [migrated]

Do any javascript runtimes (browsers, Node, etc.) ever throw uncatchable exceptions? Are any and all exceptions ever encountered in a javascript environment catchable in a try/catch statement?
1
vote
2answers
173 views

XSLT equivalent for JSON

I was interested in finding (or if necessary developing) an XSLT equivalent for JSON. As I have not found any, I was considering the possible query language to use for matching JSON paths so as to ...
2
votes
1answer
97 views

Use cases and usage patterns of futures vs callbacks

I've become interested in futures lately, mostly due to their inclusion in standard C++ - but I see there is an active debate over futures vs. callbacks in many programming areas, such as Node.js. ...
1
vote
0answers
107 views

What is the best way to approach building search functionality for a large website using PHP, MySQL and JQuery [closed]

I've a question I'm hoping I can get some assistance on because It's causing me a lot of stress in work trying to get it sorted. I figured this was the best place to ask it as it's not a specific ...
1
vote
0answers
42 views

Unit Testing a stateful framework such as Phaser?

I'm currently writing a game in TypeScript and the Phaser framework. Phaser describes itself as an HTML5 game framework that tries as little as possible to restrict the structure of your code. This ...
0
votes
2answers
75 views

What do you mean by Javascript component development? [closed]

I was recently asked by a recruiter if i knew component development with javascript. Since i was hearing this for the first time, i said i had no idea regarding it. I google it and got very few ...
-1
votes
4answers
81 views

What exactly is the meaning of “node” in Document Object Model (DOM)?

I've searched for the definition of a "node" in a programming language and I am still finding it hard to understand. Could anyone advice me in simple, layman's terms: What is a node?
-3
votes
0answers
20 views

Why is my use of .getJSON not consistently reading local JSON files? [migrated]

Here is a simple working example that reads two local data files and appends the results to the DOM displaying a card and then an unordered list representing a hand of cards. app.js var main = ...
-2
votes
1answer
63 views

Front-end or Back-end Implementation of API? [closed]

Lets say I want to implement an API from an external website, for example like Dribbble or Last.fm. I'm fairly new to this new generation of front-end MVC's (angular, etc), and most example's I've ...
0
votes
0answers
15 views

Is there a way to handle shared javascript assets in Spring?

I'm familiar with MVC web frameworks and lately very familiar with Symfony2. I want to start learning Spring, and the first practical problem I would like to try to solve is handling the reuse of ...
0
votes
0answers
23 views

Incorporating web designer's into a rails app

I have a designer who has great knowledge of HTML, CSS and JavaScript (Not jQuery or AJAX though). He gives me his designs in those files and I have to incorporate it into my apps. The site is not ...
1
vote
0answers
59 views

Implementing Facebook Flux's Dispatcher [closed]

I am getting into Facebook's Flux architecture, which is a client-side MVC variant based on React.js. It features a dispatcher, a single object that mandates unidirectional data-flow, as opposed to ...
0
votes
1answer
76 views

Does class Availability makes programming as Object Oriented Language? [duplicate]

Does class Availability makes programming as Object Oriented Language ? Most of the people think that if there is Availability Class in a language, then that language becomes Object Oriented. Is it ...
2
votes
1answer
122 views

moving around virtual keyboard

I'm creating virtual keyboard using javascript/html/css. And I can't find a good algorithm for moving from one button to another in different directions (top-bottom, left-right). Lets say I ...
6
votes
0answers
115 views

Which languages have the best support for stackful coroutines? [closed]

Various languages support (some flavor of) coroutines. One way to discriminate coroutines is whether they are stackful or not (terminology based on Ana Lucia de Moura; Roberto Ierusalimschy (2004). ...
0
votes
3answers
162 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
158 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
2answers
64 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
87 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 ...
0
votes
0answers
84 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 ...
3
votes
1answer
150 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 ...
1
vote
2answers
95 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
123 views

Programming CPU Emulator Functional Style [closed]

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 ...
1
vote
1answer
93 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 ...
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) ...
-1
votes
1answer
52 views

Detect touch sizes on screen [closed]

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
74 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 ...