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
votes
3answers
29 views

Is there any JS Framework like Symfony?

I use Symfony since many years, and I'm currently experimenting Node Webkit (to make a full Javascript/HTML app). I'd like to structure my project with a MVC-like design pattern, so I tried some ...
0
votes
1answer
285 views

Dynamic query in Mysql

I'm doing a J2EE web application with Struts2, Mybatis and a MySQL database, so what I want to allow to the user is to be free to choose different parameters to perform a select to a table in the ...
1
vote
2answers
123 views

Common techniques to integrate social media login to a website that requires account registration

I have developed websites where users would register with a username of their choice and an entry would be created in a database table that holds their username and some sort of salted password. They ...
-3
votes
0answers
36 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
1answer
578 views

How can I keep Web services requests in a DAO layer without tying the code to the DOM?

I'm working on a single page application on the node-webkit desktop app platform, which means 99.9% of all of the logic is written in JavaScript. Since this is a reboot of a project we're working on, ...
1
vote
1answer
241 views

How many Angular Controllers and/or Directives is too many?

I'm building a large, editable data table with angular, and I'm trying to figure out what the best practice is. The table will be a couple of hundred rows, with a couple of dozen columns, so upwards ...
2
votes
0answers
48 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

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
17 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
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
0answers
25 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
176 views

Methods for structuring JavaScript SDKs

I've built a REST API and have been using Backbone models throughout a couple different applications to communicate to it. I would really like to build a single JS SDK that can be used in any ...
0
votes
1answer
100 views

JavaScript strict mode compatibility

While reading about strict mode on MDN I really was surprised to read the following near the end of the page, quote: Browsers don't reliably implement strict mode yet, so don't blindly depend on ...
1
vote
1answer
115 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 ...
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 ...
-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
6answers
686 views

When to use a API/Library and when to write your own?

I am working on a large website and having been thinking a lot about when I should be using a 3rd party API/Library and when I should be writing my own implementation from scratch. There is no Library ...
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, ...
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 ...
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
2answers
144 views

Live search/filter as you type in client approach

As an exercise for myself to practice my JavaScript "skills" I'm trying to write a client-side filter. It should be able to filter "content blocks" as the user types. By "content block", I mean a ...
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 ...
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. ...
1
vote
2answers
2k views

Using WebStorm for Razor Syntax MVC

I am building a lot of client-side heavy SPA-like apps with VS2010 and MVC3/4. VS2010 Javascript/HTML/CSS editing (mostly javascript) is interminably slow and sluggish. I'd love to use something ...
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 ...
12
votes
2answers
492 views

Why does XMLHttpRequest not seem to follow a naming convention?

I've been working with the XMLHttpRequest object in JavaScript recently, and I couldn't help but notice that the casing of this name makes no sense. Why is 'XML' all in caps while 'Http' is not? ...
126
votes
3answers
34k views

Pros and Cons of Facebook's React vs. Web Components (Polymer)

What are the main benefits of Facebook's React over the upcoming Web Components spec and vice versa (or perhaps a more apples-to-apples comparison would be to Google's Polymer library)? According to ...
6
votes
5answers
371 views

Using π, φ, λ etc. as variable names while programming? [duplicate]

This is a function in the d3.v3.js file (the graph library D3.js): function d3_geo_areaRingStart() { var λ00, φ00, λ0, cosφ0, sinφ0; d3_geo_area.point = function(λ, φ) { ...
0
votes
2answers
2k views

Javascript storing data [closed]

Hi I am a beginner web developer and am trying to build the interface of a simple e-commerce site as a personal project.The site has multiple pages with checkboxes. When someone checks an element, it ...
2
votes
1answer
231 views

Local Updates in Persistent/Immutable Data Structures

I'm getting into ReactJS and am intrigued but also confused about persistent data structures. I love the idea, but I'm not sure how to take my MV*, Mutable, Observable Bindings experience in designing ...
-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
88 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 ...
43
votes
2answers
22k views

When not to use Google Web Toolkit? [closed]

I'm considering use of GWT on a major in-house web app development project, namely it's major advantage in my eyes is the cross-compilation to Javascript which would (at least theoretically) help my ...
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 ...
5
votes
2answers
8k views

How to run C++ code in browser using asm.js?

An asm.js application is very fast (near native C++ speed): http://kripken.github.io/mloc_emscripten_talk/micro4b.png But how is it possible to write one in C++, convert it to LLVM code, then do ...
5
votes
4answers
664 views

Design Patterns for Coordinating Change Event Listeners

I've been working with the Observer pattern in JavaScript using various popular libraries for a number of years (YUI & jQuery). It's often that I need to observe a set of property value changes ...
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: ...
58
votes
14answers
6k views

Is it a bad idea to return different data types from a single function in a dynamically typed language?

My primary language is statically typed (Java). In Java, you have to return a single type from every method. For example, you can't have a method that conditionally returns a String or conditionally ...
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 ...
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?
2
votes
0answers
69 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 ...
2
votes
1answer
121 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 ...
1
vote
1answer
122 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 ...
0
votes
2answers
70 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 ...
0
votes
1answer
119 views

Creating a voting platform for submissions during timeperiod

I have a site where stories are submitted at any time by users. The staff would like the ability to create a voting period at any time. For example, they can choose to open up voting from today until ...
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 ...