Questions tagged [javascript]

JavaScript (not to be confused with Java) is a high-level, dynamic, multi-paradigm, weakly-typed language used for both client-side and server-side scripting. Use this tag for questions regarding common implementations of ECMAScript, JavaScript, JScript, etc. JS does not typically refer to its ECMA-cousin, ActionScript.

Filter by
Sorted by
Tagged with
3
votes
5answers
1k views

Is a genetic algorithm a correct approach to this problem?

I am trying to calculate a set of items that produce the highest damage output in a video game. There are about 50 different items, of which you can choose 6. There are all sorts of conditions that ...
4
votes
2answers
378 views

Indenting/breaking jquery chains for readability

I'm curious as to how other people indent/break long jQuery chains, as I can never decide what is more readable (particularly when using .end() to "close" a block of methods e.g. $(this).not(":has(....
3
votes
1answer
4k views

How to generate nonce for Ajax web requests

As many of you know WordPress uses "secret key" like thing for every AJAX request. Making each request unique and also 'somewhat' secure (just a step ahead than nothing). How would I implement the ...
1
vote
1answer
627 views

How to submit a bug/fix for jquery unobtrusive validation?

I found a small bug in the microsoft mvc3 remote validation, concerning the clientside javascript implemented in jquerys unobtrusive javascript. The problem/bug can be fixed by adding a few lines to ...
3
votes
6answers
2k views

“As” Naming Convention [closed]

I'm experimenting with a naming convention I've devised and am seeking opinion. It involves the use of an "As" infix, and at this point I am envisioning it in the context of JavaScript, C# and C++ ...
-1
votes
1answer
163 views

Has anyone collated a comprehensive list of all the prototype-programming style javascript work? [closed]

I'm looking for a comprehensive (or as close as possible) list of all the prototype-programming style javascript work done to date. Does anyone know of such a list somewhere, or have the knowledge to ...
5
votes
7answers
484 views

Is there a way to play the role of Javascript with any other language like C#? [closed]

Is there a way to play the role of Javascript with any other language like C#? One way came up in my head is, having silverlight installed, using C# instead of Javascript for all the client side ...
29
votes
1answer
5k views

How is client-side javascript covered by the GPL?

If I used a GPL-licensed Javascript library in a web application, would I then have to offer source code of the whole site to anyone who downloaded and executed the Javascript lib?
2
votes
1answer
615 views

How do you name “javascript:” prefix in inline event handlers?

In the following code: <a onclick="javascript:alert()"> how do you name the javascript: part? Protocol, pseudo-protocol, scheme, label, prefix? I am only trying to figure out a common name ...
16
votes
12answers
4k views

When learning JS, what was your your Aha-moment? [closed]

Do you remember when you were learning JavaScript? What was the moment that you suddenly "got it"? (For example, my CSS aha-moment was when I learnt about the box model...) The reason I´m asking is ...
13
votes
7answers
3k views

What constitutes “improper use” of the javascript Eval feature? [closed]

Eval is a notoriously controversial language feature. Douglas Crockford flat out rejects it. I'm wondering what specific risks Eval brings about. According to this question, Improper use of eval ...
5
votes
1answer
775 views

OpenID implementation - PHP, Javascript, MySQL

I've started doing some research on the technologies that I will need for my website. I'm trying to implement a really simple website with OpenID user registration. The website will store a block of ...
22
votes
10answers
3k views

Good resources and tools for modern, heavy JavaScript development? [closed]

I am interested in doing some projects that involve heavy use of JavaScript. Namely HTML5 based canvas games, potentially using node.js as well. I am interested in learning modern best practices, ...
12
votes
2answers
1k views

How can I use my coding skills for good?

By this autumn my two small websites should be generating around a total of $1200 a month with minimal/zero input which is enough to for me to live on comfortably enough. Rather than embark on ...
1
vote
8answers
12k views

Is it better to learn html, javascript, php, then mysql if you want to start your own site? [closed]

Is it better to learn html, javascript, php, then mysql if you want to start your site? Is it better to learn it in that order or not?
8
votes
6answers
8k 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 ...
10
votes
2answers
548 views

How do you unit test your javascript

I spend a lot of time working in javascript of late. I have not found a way that seems to work well for testing javascript. This in the past hasn't been a problem for me since most of the websites I ...
2
votes
2answers
383 views

Javascript business model

Does anyone know anything about slidedeck's business model (see link below)? These guys are a javascript component that they sell online. As the tech savvy know - It's very difficult to sell ...
7
votes
3answers
789 views

Is there a canonical book on creating highly interactive websites (eg. “Flash” like) with HTML5/CSS3/JS/jQuery? [closed]

I know some of the basics of these technologies already, but it is mostly limited to more static sites. Using things like HTMl5 semantic elements, CSS3 gradients, shadows, @font-face etc. Is there a ...
4
votes
5answers
297 views

Is it possible for a technically open source application (specifically javascript) to be released under a proprietary license?

A javascript application release won't technically be closed source - at best it can be obfuscated. Given that, my question has two parts: Is it at all possible to release a technically open ...
2
votes
3answers
311 views

Recomendations for Front-End to Programming Transition

I am a front-end developer seeking to add programming to my skillset. As with all things, I'm sure that practice and practical application will aid me most, but I am currently having trouble wrapping ...
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 ...
4
votes
9answers
625 views

One good reason for a rewrite

I have a personal web project I cut my teeth on learning how to program. I wrote it in PHP and learned as I went. I eventually I re-factored it to use MVC and removed all mixing of php/html. Right ...
5
votes
1answer
780 views

Why are Javascript for/in loops so verbose?

I'm trying to understand the reasoning behind why the language designers would make the for (.. in ..) loops so verbose. For example: for (var x in Drupal.settings.module.stuff) { alert("Index: " ...
5
votes
3answers
2k views

Why make JavaScript class based?

JavaScript is a prototype language. To turn it into a class based language adds little value? I am not talking about best-practice here. I remember reading an article from way back, which claimed that ...
139
votes
15answers
28k 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 ...
5
votes
4answers
7k views

What are the basic skills a beginner JavaScript programmer should have? [closed]

In NYC, we are working on creating a collaborative community programming environment and trying to segment out software engineers into differing buckets. At present, we are trying to define: ...
21
votes
12answers
2k views

How to talk a client out of a Flash website? [closed]

I have recently been doing a bunch of web side projects through word of mouth recommendations only. Although I am much more a of a programmer than a designer by any means, my design skills are not ...
35
votes
10answers
9k 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 ...
2
votes
2answers
1k views

Using JSTestdriver to test UI/DOM?

Can JSTestDriver be used to test DOM behaviors and interactions? I see I can write tests to exercise pure JS but how do I go about testing against HTML or DOM? Can I deliver with each test HTML for ...
5
votes
3answers
888 views

Weighing pros and cons for using jQuery for just one widget

I have been using html select boxes or textboxes for date input. On submit, the date is validated and if invalid an error is returned. I have avoided javascript calendars thus far, but jQuery ...
5
votes
3answers
3k views

What JavaScript inconsistencies should I look out for? [closed]

I remember reading some "funny" examples once of weird results JavaScript can give when you, for example, add strings to numbers etc. Does anyone have any good examples or a link to the blog that I ...
5
votes
6answers
363 views

Does my JavaScript look big in this?

As programmers, you have certain curtains to hide behind with your code. With PHP all of your code is server side preprocessed, so this never see's the light of day as far as the user is concerned. If ...
9
votes
2answers
744 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
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 ...
24
votes
11answers
17k 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 ...
2
votes
3answers
658 views

Starting my first RoR project, what JS library is good to go with it?

I'm starting my first Ruby on Rails project as I've been excited about the language for quite a while now and I'm sick of writing PHP. I've gathered that rails is pretty much an automation framework ...
25
votes
8answers
10k 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. ...
55
votes
2answers
33k 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 ...
4
votes
3answers
5k views

Can desktop applications be written using javascript?

Is it currently possible to write desktop applications using javascript, html, css? Possible solutions: Use Adobe AIR runtime and program in js. But no, if I'm using AIR, the AS3 suites it the most. ...
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 obscure,...
3
votes
2answers
473 views

What is “Simplified JavaScript”?

Douglas Crockford makes reference to Simplified JavaScript in this article about Top Down Operator Precedence. Unfortunately he only makes references to it in this article. The best explanation I ...
-1
votes
2answers
176 views

Why don't browsers have the ability to differentiate between events triggered via input devices and scripts ex: element.onEvent()?

Why don't browsers have the ability to differentiate between events triggered via input devices and scripts ex: element.onEvent()? Wouldn't this be a very simple way counter attack web spam bots? Or ...
3
votes
1answer
184 views

Alternative methods for maintaining JavaScript source

I'm looking for other options for maintaining my personal JavaScript namespace. The problem I'm having boils down code Organization Vs. Performance. I would simply LOVE to be able to separate major ...
10
votes
4answers
6k 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 ...
5
votes
2answers
7k views

Common mistakes with javascript arithmetic [closed]

I've ran into several oddities using javascripts floating point arithmetic, but I can never recall them off the top of my head! What are some common mistakes when using JavaScript to do math?
27
votes
12answers
8k views

How did JavaScript become popular?

In ancient history, Brendan Eich had a language design, and in today's world, JavaScript is a popular language implemented and used in many different places. What caused the language to become ...
3
votes
4answers
6k views

Can I test effectively javascript functions with a PHP unit-testing framework?

If I want to unit-test some of my javascript functions, would it be more efficient (and doable) to use the already installed PHP unit-testing framework, or should I use a javascript unit-testing ...
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 ...
60
votes
8answers
56k 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 ...