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)

85
votes
3answers
22k 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 ...
84
votes
15answers
9k views

Why did memory-managed languages like Java, Javascript, and C# retain the `new` keyword?

The new keyword in languages like Java, Javascript, and C# creates a new instance of a class. This syntax seems to have been inherited from C++, where new is used specifically to allocate a new ...
82
votes
2answers
6k views

What is JavaScript, really?

All this started when I was looking for a way to test my webpage for JavaScript conformance like the W3C HTML Validator. I have not found one yet. So let me know if you know of any... I looked for ...
74
votes
23answers
6k views

How do developers find the time to stay on top of latest technologies? [closed]

I was a freelance web developer until circa 2004 when I started going down the management route but have decided to try to get back into development again (specifically JavaScript and HTML5 web/mobile ...
68
votes
20answers
15k views

Should I bother to develop for JavaScript disabled? [duplicate]

Should I bother to develop for JavaScript disabled? I feel that my time is better spent developing for the majority.
67
votes
27answers
8k views

How important is graceful degradation of JavaScript?

Should web developers continue to spend effort progressively enhancing our web applications with JavaScript, ensuring that features gracefully degrade, thereby ensuring accessibility? Or should we ...
52
votes
3answers
4k views

Why do JavaScript frameworks/libraries have functions which already exist in pure JavaScript?

I wonder why frameworks/libraries have their own helpers although they exist natively already. Let's take jQuery and AngularJS. They have their own each iterator functions: jQuery.each() ...
51
votes
2answers
5k views

Are there any OO-principles that are practically applicable for Javascript?

Javascript is a prototype-based object oriented language but can become class-based in a variety of ways, either by: Writing the functions to be used as classes by yourself Use a nifty class system ...
50
votes
14answers
5k views

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

I come from a statically typed language background (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 ...
45
votes
8answers
6k views

Client-side coding: How to prevent malicious use?

Over the last few years, the trend for client-side (browser) applications has really taken off. For my latest project, I have decided to try and move with the times and write a client-side ...
41
votes
8answers
5k views

How do I get started with HTML5? [closed]

What is the recommended workflow to learn HTML5? What tools should I install? What SDK? Where to start? How to test? How to debug? What do I read? I understand that what is often labelled as "HTML5 ...
41
votes
8answers
18k views

Why do people disable JavaScript?

I asked a question yesterday Should I Bother to Develop For JavaScript Disabled?. I think the consencus is: Yes, I should develop for JavaScript Disabled. Now I just want to understand why users ...
41
votes
6answers
9k views

What are the pros and cons of Coffeescript? [closed]

Of course one big pro is the amount of syntactic sugar leading to shorter code in a lot of cases. On http://jashkenas.github.com/coffee-script/ there are impressive examples. On the other hand I have ...
40
votes
13answers
9k views

How does Python's handling of line-breaks differ from JavaScript's automatic semicolons?

Javascript has a feature called Automatic Semicolon Insertion where basically if the parser encounters an invalid token, and the last token before that was a line break, then the parser will insert a ...
40
votes
13answers
5k views

Is it considered bad practice to have PHP in your JavaScript

So many times on this site I see people trying to do things like this : <script type="text/javascript"> $(document).ready(function(){ $('<?php echo $divID ?>').click(funtion(){ ...
40
votes
6answers
3k views

How safe are hidden AJAX requests that fake performance?

What is a hidden AJAX request? I've noticed an increase in the usage of hidden AJAX requests designed to make a user's action appear to happen immediately. I'll refer to this type of AJAX request as ...
40
votes
6answers
30k views

Advantages of using pure JavaScript over JQuery

What are the advantages of using Javascript-only versus using JQuery-only? I have limited experience with JavaScript and JQuery coding. I've added bits and snippets of each to HTML pages but I've ...
39
votes
11answers
3k views

Is there any reason not to go directly from client-side Javascript to a database? [duplicate]

Possible Duplicate: Writing Web “server less” applications So, let's say I'm going to build a Stack Exchange clone and I decide to use something like CouchDB as my backend store. If I use ...
38
votes
2answers
20k 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 ...
37
votes
5answers
6k views

Why aren't there native Javascript interpreters for Windows/Mac/Linux?

It seems to me it would be very useful to use Javascript for general server side scripting tasks as it has more or less the same features as Perl and Python. But AFAIK there are no generally available ...
37
votes
6answers
2k views

Why not embed styles/scripts in HTML instead of linking?

We concatenate CSS and JavaScript files to reduce the number of HTTP requests, which improves performance. The result is HTML like this: <link rel="stylesheet" ...
33
votes
16answers
4k views

Should I continue my self-taught coding practice or learn how to do coding professionally? [closed]

Lately I've been getting professional work, hanging out with other programmers, and making friends in the industry. The only thing is I'm 100% self-taught. It's caused my style to extremely deviate ...
33
votes
3answers
6k views

What's so bad about the DOM?

I keep hearing people (Crockford in particular) saying the DOM is a terrible API, but not really justifying this statement. Apart from cross-browser inconsistencies, what are some reasons why the DOM ...
33
votes
4answers
38k views

Reasons NOT to use JSF [closed]

I am new to StackExchange, but I figured you would be able to help me. We're crating a new Java Enterprise application, replacing an legacy JSP solution. Due to many many changes, the UI and parts of ...
33
votes
2answers
2k views

Strategy for generating unique and secure identifiers for use in a “sometimes offline” web app

I have a web based project that allows users to work both online and offline and I'm looking for a way to generate unique ids for records on the client side. I'd like an approach that works while a ...
31
votes
14answers
3k views

Is it a common practice to minimize JavaScript usage when building a website?

I've been a web developer for almost 10 years and I've gotten into the habit of trying not to use JavaScript whenever possible. I'm not talking about building web apps here, but database driven ...
31
votes
5answers
6k views

How easy is it to hack JavaScript (in a browser)?

My question has to do with JavaScript security. Imagine an authentication system where you're using a JavaScript framework like Backbone or AngularJS, and you need secure endpoints. That's not a ...
31
votes
4answers
5k views

The importance of Design Patterns with Javascript, NodeJs et al

With Javascript appearing to be the ubiquitous programming language of the web over the next few years, new frameworks popping up every five minutes and event driven programming taking a lead both ...
30
votes
10answers
5k views

Why aren't there other client-side scripting languages for websites? [closed]

Why is there just support for JavaScript and some VBScript in browsers today? I know JavaScript is good and all, but wouldn't having the option of using another programming language help promote ...
30
votes
2answers
2k views

Why does Javascript treat days and months differently?

I've noticed that in JavaScript, when creating a Date, months are zero based, and days aren't. For example: var foo = new Date(2012, 1, 1) produces February 1st 2012 Why is this?
30
votes
3answers
6k views

What does Douglas Crockford mean when he says jQuery doesn't scale? [closed]

In the Q&A section of this talk, Douglas Crockford says that jQuery doesn't scale as well as some other popular libraries. What does he mean by that, and what is it about the other libraries that ...
29
votes
7answers
2k views

Design Patterns for Javascript [duplicate]

A lot of web frameworks have a MVC-style layout to code and approaching problems. What are some good similar paradigms for JavaScript? I'm already using a framework (jQuery) and unobtrusive js, but ...
29
votes
5answers
1k views

Javascript modularity, server based MVC & business reality

I understand this is a very broad question, but I have worked with various aspects of this problem individually and am struggling to bring all the concepts and technologies together. I'd like to ...
28
votes
8answers
5k views

Is splitting up a function into several inner functions an anti-pattern? [duplicate]

Imagine a long and complicated process, which is started by calling function foo(). There are several consecutive steps in this process, each of them depending on result of the previous step. The ...
28
votes
4answers
5k views

Does Dart have any useful features for web programmers?

http://www.dartlang.org/ I've checked out the site very briefly, and got curious. Is there any advantages of using Dart? Is it just a replacement for JavaScript? It looks like simpler Java. Writing ...
28
votes
10answers
4k views

Is it worth moving from Microsoft tech to Linux, NodeJS & other open source frameworks to save money for a start-up?

I am currently getting involved in a startup, I am the only developer involved at the moment, and the other guys are leaving all the tech decisions up to me at the moment. For my day job I work at a ...
28
votes
8answers
8k views

When should JavaScript generate HTML?

I try to generate as little HTML from JavaScript as possible. Instead, I prefer to manipulate existing markup whenever I can and only generate HTML when I need to dynamically insert an element that ...
27
votes
5answers
2k views

Referencing external javascript vs. hosting my own copy

Say I have a web app that uses jQuery. Is it better practice to host the necessary javascript files on my own servers along with my website files, or to reference them on jQuery's CDN (example: ...
26
votes
9answers
2k views

Ashamed to admit using jQuery? [closed]

Something I've noticed over the past few weeks is how many big commercial websites use jQuery combined with lots of plugins - but don't admit it. They will rename the main library to something ...
26
votes
6answers
2k views

Tight Coupling Between Javascript, HTML, and CSS: A More Modern Approach?

It's very common to see Javascript bound to certain selectors to find elements, store data, and listen for events. It's also common to see these same selectors used for styling. jQuery (and its ...
26
votes
5answers
7k views

Pros and cons of an HTML/JavaScript only web app

I come from an ASP.NET forms background and have found server side coding very powerful in the past. More recently, however, I have been wanting to phase out the server side code of the front-end and ...
25
votes
14answers
7k views

What benefits are there to native JavaScript development? [closed]

Given how much simpler jQuery development is, when compared to native JavaScript, what makes people forgo libraries like jQuery altogether? Is this because jQuery has limitations or it is slow? I ...
25
votes
14answers
2k views

What shall I include in a 10 week web technologies course? [closed]

In September I will be teaching a university module on web technologies. This session will be available to 1st year (freshman) students who don't necessarily have any programming knowledge or know ...
25
votes
11answers
4k views

Is javascript worth learning if you do not plan on being a web developer?

I heard Javascript is a full language just like c++. Is this true? What else is it good for programming besides web stuff?
24
votes
7answers
9k views

Self-Executing Anonymous Function vs Prototype

In Javascript there are a few clearly prominent techniques for create and manage classes/namespaces in javascript. I am curious what situations warrant using one technique vs. the other. I want to ...
23
votes
9answers
2k views

How does a programmer used to static languages cope with lack of Javascript tooling

I have programmed pretty much exclusively in compiled languages, particularly Java, for most of my career. One of my favourite things about Java is how productive you can be, and how little code you ...
23
votes
8answers
7k views

The importance of javascript and the best way to learn it? [duplicate]

I'm a new graduate, but I have been doing web development for about six months. When I was finishing university the server side languages (PHP, Java) were more important then client side languages. ...
23
votes
2answers
17k views

Mixing Angular and ASP.NET MVC/Web api?

I come from using ASP.NET MVC/Web API and now I am starting to use Angular but I am not clear on the proper way to mix them. Once I am using Angular does the MVC server side concepts still provide ...
22
votes
11answers
11k views

How necessary is it to learn JavaScript before jQuery? [closed]

In my opinion, when I looked at JavaScript, it looked like not my cup of tea. When I came across jQuery, I loved it. I sat and watched Nettuts+ 15 days of jQuery screencasts, 1 year later and now I'm ...
22
votes
1answer
2k views

The Box Model: Internet Explorer vs. W3C

Today, the Internet Explorer Box Model problem is mostly a non-issue. Most web developers place a <!DOCTYPE> tag to enforce standards compliance, and nobody really cares about supporting ...