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)

9
votes
4answers
4k views

Where to master HTML, CSS and Javascript? [duplicate]

Possible Duplicate: What should a developer know before building a public web site? I gotten interested in web-development lately. I am still a student. I learnt basics of HTML, CSS and ...
9
votes
3answers
259 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
3answers
226 views

How do you use duck typing in javascript without always checking for properties and methods?

I know javascript uses duck typing and at first I thought this would make polymorphism easy compared to strongly typed languages like C#. But now my functions that take arguments are littered with ...
9
votes
1answer
3k views

Legal ramifications of use of the JavaScript trademark?

It's widely known that the name "JavaScript" is trademarked by Oracle (formerly a trademark of Sun, formerly a trademark of Netscape). However, others seem to have no problem using the JavaScript ...
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
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
589 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
3k 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
1answer
2k views

Prevent Click Fraud in Advertisement system with PHP and Javascript

I would like to build an Advertising project with PHP, MySQL, and Javascript. I am talking about something like... Google Adsense BuySellAds.com Any other advertising platform My question is ...
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
5answers
8k 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 ...
8
votes
5answers
745 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
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 ...
8
votes
4answers
654 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
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
7k 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
10k 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
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 ...
8
votes
2answers
3k 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 ...
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
873 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
510 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
5answers
1k 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 ...
8
votes
3answers
1k 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
233 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
3answers
6k 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 ...
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
1answer
449 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: ...
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 ...
8
votes
3answers
886 views

How to properly validate your code?

I have about 4000 lines of code for a web-application in JavaScript / PHP / CSS / HTML. How can I test it properly? I only support the latest version of IE and Safari. I've worked out all the bugs. ...
8
votes
1answer
1k views

JavaScript objects and Crockford's The Good Parts

I've been thinking quite a bit about how to do OOP in JS, especially when it comes to encapsulation and inheritance, recently. According to Crockford, classical is harmful because of new(), and both ...
8
votes
2answers
903 views

If I drop cookies with JavaScript will it still be compliant with the EU ICO Cookie Law?

The challenge proposed to me as to create a widget to apply in other sites that makes a website compliant with the cookie law[1]. Can I do this without changing server code? I mean, if there's code ...
8
votes
1answer
1k views

HTML5 video sprites

I'm currently working on a project where there is a requirement to dynamically composite multiple synchronised video sources onto a single canvas. The initial prototype I put together loaded the video ...
7
votes
7answers
8k views

Is it necessary to memorize code?

I am a new developer, who just got hired at a big company. I don't know how but I guess they are desperate. However, I am well-versed with HTML5/CSS3 though things change and new things are released ...
7
votes
3answers
2k views

Benefits to starting JavaScript “for” loops at 0, or just traditional? [duplicate]

Possible Duplicate: Defend zero-based arrays I'm running code that loops through an array of HTML IDs. With the HTML IDs named content1, content2, …, content12, my loop looks like: for ...
7
votes
9answers
2k views

Is it worth Learning XML as a web developer when JSON is better for AJAX? [duplicate]

Is it worth Learning XML as a web developer when JSON is better for AJAX? or is it better to concentrate on JSON/Javascript for AJAX?
7
votes
9answers
7k 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 ...
7
votes
3answers
6k views

Why do browsers leak memory?

A colleague and I were speaking about browsers (using a browser control object in a project), and it appears as plain as day that all browsers (Firefox, Chrome, IE, Opera) display the same ...
7
votes
3answers
735 views

When and Where should we use hoisting in Javascript [closed]

I'm new to Javascript. I'm learning the concept of hoisting in Javascript. Based on the Javacsript tutorials in Mozilla website, I came across this word hoisting. According to those tutorials, ...
7
votes
4answers
694 views

Readability of || statements

On HTML5 Boilerplate they use this code for jQuery: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script>window.jQuery || ...
7
votes
3answers
836 views

Have they missunderstood currying or have I?

This question is similar to the question posted on Does groovy call partial application 'currying'?, but not completely the same, and the answers given there do not really satisfy me. I would ...
7
votes
5answers
524 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 ...
7
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 ...
7
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 ...
7
votes
5answers
1k views

Why JavaScript? What's the advantages? [closed]

This is not a simple question, but I was thinking, what advantages are really there in the JavaScript language? We all use JavaScript on the browser, of course, there is no other choice (you can use ...
7
votes
1answer
298 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 ...