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)

10
votes
1answer
376 views

Building a computer system with JS? [closed]

I recently finished this book called The Elements of Computing Systems where you build a working computer system from the ground up, starting from basic logic gates, to creating your own machine code ...
10
votes
2answers
416 views

Why can we delete some built-in properties of global object?

I'm reading es5 these days and find that [[configurable]] attribute in some built-in properties of global object is set to true which means we can delete these properties. For example: the join ...
9
votes
15answers
2k views

Is obtrusive JavaScript ever ok?

I was thinking that if all the users of a website are required to have JavaScript enabled, Is it ok to use obtrusive JavaScript? I'm all for progressive enhancement, but what's the point when an ...
9
votes
13answers
4k views

Would a statically typed alternative to JavaScript on webpages be practical?

Preference for dynamic and static typing is largely a matter of taste, and different people find them more or less suitable in different situations. My question is, would it be technically possible ...
9
votes
11answers
11k views

Do I have to learn html and javascript to create web applications? [closed]

I am an experienced Java programmer, and I want to create a complex web application requiring dynamic pages, drawings, etc (take SO as an example). Do I have to learn javascript/html in order to ...
9
votes
9answers
811 views

What does Google or Microsoft get by hosting JS files on their Content Delivery Networks (CDN)?

As you know Google, Microsoft and jQuery.com offer JS files on their CDN. To do this, they must need to operate significant servers which must come at a cost to them. Why do they do this and what do ...
9
votes
5answers
5k 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 ...
9
votes
5answers
9k views

What Special characters should one allow for a Phone Number?

So I am designing a webpage which will be used for global users, includes users from Canada, US, India, UK etc. I need to apply validations for this phone number field, but I'm not sure the best way ...
9
votes
5answers
3k views

PHP, HTML, Javascript and writing good practices

I realized I have to write down a convention specification about HTML, JavaScript and PHP coding for me and my team. In web development, just like in C++, I'm definitely a fan of indentation and ...
9
votes
3answers
2k views

What stops HTML5 and JS apps to perform as good as native apps?

From what I understand, HTML is a mark-up language, so is the content of XAML, XIB and whatever Android uses and other native UI development frameworks. JavaScript is a programming language used ...
9
votes
2answers
649 views

Is automatically generating passwords during registration a good idea?

I'm developing a registration system for a project I'm working on. Since users tend not to sign up if the process is too long, I've thought to require (at least initially) just their email, where I ...
9
votes
4answers
1k views

Should I parse XML on the server or provide a proxy and let the browser parse it?

I need to interface with a 3rd party API. With this API I make a GET request from within the end user's browser and receive an XML response. This data is to be used in a browser based application ...
9
votes
2answers
4k views

What is an Activation object in JavaScript?

In a given execution context, the Variable object is the Activation object of that execution context. From my research online, I am able to find the previous sentence rephrased in different ways but ...
9
votes
3answers
287 views

Cross-language Test-Driven Development

The short question: How do you follow Test-Driven Development on a project that spans multiple languages? Specifically, I'm writing a web application that uses JavaScript and PHP, and I want to ...
9
votes
3answers
2k views

Choosing a JavaScript Asynch-Loader [closed]

I’ve been looking at various asynchronous resource-loaders and I’m not sure which one to use yet. Where I work we have disparate group-efforts whose class-modules may use different versions of jQuery (...
9
votes
2answers
3k views

Is localStorage under The Cookie Law?

I'd like to avoid having the cookies banner on my websites where possible. Could I store session id's in localStorage to bypass implementing the banner?
9
votes
5answers
2k views

Algorithm for flattening overlapping ranges

I am looking for a nice way of flattening (splitting) a list of potentially-overlapping numeric ranges. The problem is very similar to that of this question: Fastest way to split overlapping date ...
9
votes
2answers
1k views

Moving all UI logic to Client Side?

Our team originally consisted of mostly server side developers with minimum expertise in Javascript. In ASP.NET we used to write a lot of UI logic in code-behind or more recently through controllers ...
9
votes
3answers
7k views

Responsive Web Design vs. User-Agent Sniffing

The CSS3 media query feature has led to many interesting possibilities in terms of developing websites which adjust to many different screen sizes and devices. However, in practice, I'm starting to ...
9
votes
1answer
1k views

Who first created or popularized the original XMLHTTPRequest / MSXML?

I'm trying to understand the origins of AJAX, and think MSXML and XMLHTTPRequest were the objects that started it all. Which came first, and/or became the defacto way to create dynamic pages?
9
votes
2answers
612 views

Do I need to paste open source license information at the top of my webpage?

I'm developing a JavaScript application that uses several open source JavaScript projects. All their licenses have a phrase like "You must give any other recipients of the Work or Derivative Works a ...
9
votes
6answers
4k views

Code review guidelines for CSS, JS and HTML

I have been asked to create guidelines for review CSS, JS and HTML. I know there are coding guidelines for JS but I don't know any about HTML and CSS. To review JS I will certainly follow those ...
9
votes
2answers
321 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
12answers
8k views

How to become a JavaScript ninja? [closed]

I want to choose JavaScript as my main development field, alongside HTML and CSS to become a developer commonly known as front-end developer. But I don't know how to become a JavaScript professional. ...
8
votes
9answers
8k views

How to become an expert in Python, PHP and Javascript? [closed]

So I've been programming for about 9ish months now, and I've taught myself some Python, some PHP and some Javascript. I want to become better at these languages - I can hack something out, but a lot ...
8
votes
6answers
6k views

Focus on Javascript or Jquery? [closed]

I am a student in college, and I notice that a lot of companies look for people who have experience with Javascript. Does this include Javascript's libraries, like JQuery? Or, are they looking for ...
8
votes
3answers
1k views

Has Javascript developed beyond what it was originally designed to do?

I've been talking with a friend about the purpose of Javascript, when and how it should be used, etc. He quoted that: JavaScript was designed to add interactivity to HTML pages [...] ...
8
votes
11answers
1k views

What are some good ways for an intermediate programmer to build skills? [closed]

Preface: I work mostly in Python, and Web Dev languages (HTML, CSS, Javascript and Jquery, PHP) I'm proficient at coding but I want to get better. In larger more advanced projects my programming ...
8
votes
4answers
2k views

Did jQuery kill the JavaScript discussions? [closed]

There are over 100,000 questions on Stack Overflow tagged as questions relating to JQuery troubleshooting/usage. Compare this to the 124,000 questions on stack overflow that are tagged for JavaScript ...
8
votes
5answers
759 views

What is the historical basis of using Javascript in web programming?

I come from a scientific biology background where we also use Python a lot. Now that I've begun to start with Web development, I've consistently found myself wondering just why it is that JavaScript ...
8
votes
4answers
692 views

Could a programming language work as well without statements?

As programming in JavaScript, I've noticed everything that can be done with statements and blocks can be done with expressions alone. Can a programming language work fine with only expressions? And, ...
8
votes
6answers
564 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 ...
8
votes
3answers
3k views

Ajax race conditions

Is there a pattern or standard way to handle Ajax race conditions? Take the following example. You have two tables. Clicking a row on table 1 removes the data from DB and then updates table 2 (which ...
8
votes
4answers
3k views

What exactly undefined means in JavaScript? Why it's there? What usages it has? How it could be useful?

In JavaScript, we have something called undefined. I said something, because I really don't know if it's a base class, or a built-in variable, or a keyword, or anything else. I just know that it's ...
8
votes
1answer
344 views

Hoisting in Javascript === Compiling?

I came across an interesting perspective at a recent job interview. Hoisting in Javascript is about moving the variable declarations and function declaration at the top of the script. Can we call ...
8
votes
3answers
1k views

Does it make sense to use jQuery in modern-webkit-only web applications?

I'm lately working on a few mobile web apps for Android (2.3+) and iOS (4+). Their browsers support most of ECMAScript5, which is very powerful, and I wanted to use language features where possible, ...
8
votes
4answers
8k views

What is the advantage of assigning a function to a var?

Given this Javascript example I found var sum = function() { var i, sum = 0; for(i = 0; i < arguments.length; i += 1) { sum += arguments[i]; } return sum; }; What advantage is there ...
8
votes
4answers
11k views

Is node.js a good fit for background processing?

I'm slowly learning node.js and have a small project I want to start. The project will have a lot of background processes (downloading data from external sites, parsing CSV files, etc.). A big "win" ...
8
votes
2answers
3k views

Any point in using ES6 Map when keys are all strings?

Plain object keys must be strings, whereas a Map can have keys of any type. But I have little use for this in practice. In nearly all cases, I find myself using strings as keys anyway. And presumably ...
8
votes
4answers
3k views

JavaScript application design patterns [duplicate]

I need to write a PhoneGap application with JavaScript and I'm thinking of the code design patterns. I've read some books of JavaScript design patterns but can't really see the advantages/...
8
votes
2answers
1k views

Fundamental Difference between fn() and new fn() in javascript

In what all aspects, calling a function with and without new keyword differ in javascript? I mean what all things are differing between? testFn() vs new testFn()
8
votes
3answers
1k views

What common programming problems are best solved by using prototypes and closures?

As much as I understand both concepts, I can't see how can I take advantage of JavaScript's closures and prototypes aside from using them for creating instantiable and/or encapsulated class-like ...
8
votes
4answers
2k views

What are the best practices for rapid prototyping using exclusively HTML/CSS/JS [closed]

I'm developing a prototype of a web application. I want to only use HTML, CSS and Javascript. I prefer to use my text editor and not having to learn (or pay, for that matter) a new tool like Axure. ...
8
votes
3answers
960 views

Using CSS classes as decorators - a good pattern?

I've been building a web-app with a fairly complex GUI - many small elements alongside eachother and within other elements that need various behaviours (dragging, clicking, but context-sensitive). My ...
8
votes
2answers
540 views

Doesn't dependency injection push the testing burden further down the chain?

I'm learning about dependency injection and while I can see the appeal of it when writing functional libraries, I fail to see how it solves anything when you'll also be the one using the libraries. ...
8
votes
3answers
2k views

Javascript simple code to understand prototype-based OOP basics [closed]

I know Javascript for some time, although I am not a heavy user, I know it the first from the time when Netscape was my browser. I pretty much understand the main things, but since JavaScript approach ...
8
votes
1answer
250 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 ...
8
votes
1answer
524 views

Is obtrusive JavaScript required to support a feature of AngularJS?

I'll start by saying I'm just learning about AngularJS, and I was reading this article, which seems to advocate for obtrusive JavaScript as the right thing: http://www.ng-newsletter.com/posts/angular-...
8
votes
2answers
1k views

Are side-effects in Array's “every”, or “some” bad?

I've always been taught that having side-effects in an if condition are bad. What I mean is; if (conditionThenHandle()) { // do effectively nothing } ... as opposed to; if (condition()) { ...
8
votes
2answers
2k views

Javascript MVC application design (canvas)

I'm having difficulty grasping how to structure/architect a canvas application using an MVC like approach in Javascript. UI will be fairly fluid and animated, the games fairly simplistic but with ...