Tag Info

Hot answers tagged

76

Let's talk about cars. Oh wait, we already did - remember that time we met, a few weeks ago? We talked about cars. In fact, you seemed to be quite the expert on cars. You were able to explain, in detail, all of what's right, wrong, and exciting about the latest Formula 1 race. You knew by heart all of Lamborghini's models, including their price and ...


50

Stop using buzzwords and try making strong arguments instead. Even the Wikipedia page for Unobtrusive JavaScript says that the term isn't formally defined. It may be a blanket term for a number of good ideas, but if it sounds like a mere fad or fashion your boss and coworkers won't pay a lot of attention. Worse, if you keep going on about something they ...


49

First off - it's impossible to use jQuery only, all jQuery does is add a $ object to your global scope, with a bunch of methods in it. Even more manipulative libraries like prototype aren't an alternative to javascript, they're a toolbelt to solve common problems. The main advantages to adding jQuery to your toolbelt would be: browser compatibility - ...


47

To answer that question, I'm going to ask you a rhetorical question about another structure that have similar property to the DOM elements that jQuery manipulates, that is the good old iterator. The question is: How many operation do you need on a simple iterator? The question can be answered easily by looking at any Iterator API in a given language. You ...


38

If you watch the video, he doesn't talk about jQuery formally. It is a quick response to a somewhat offtopic question from someone after the presentation....at the end of the presentation, about minute 1:29. He says a lot of good things about jQuery. The part about it not scaling well, he says he doesn't think jQuery scales very well for very ...


34

Start your for loops where ever you have to start them. The reason a lot of for loops start at 0 is because they're looping over arrays, and in most languages (including JavaScript) arrays start at index 0.


32

There is no way to avoid that. They are coupled because they interact with each other. If your javascript intends on doing any kind of DOM manipulation, then it needs a way to reference the DOM. There are various conventions for it. The Level 2 DOM API provides the getElementById, getElementByTagName, and getElementsByName methods. To this day these are ...


31

jQuery makes it easier and shorter to write JavaScript code. But jQuery does not replace JavaScript by an own language. If you use jQuery, you don't need to know some things like how to find an element based on its id or its name, or how to loop through the <li/> elements of an <ul/> list (since you can easily do it with jQuery: ...


27

It's more important to study the language than it is to study the framework. Learn the language well, and you'll use the framework well. In order of importance (most important first): Fundamental programming principles - Algorithms, data structures, etc. Language paradigms - OOP, Functional, etc. Language features. Syntax and frameworks.


26

Well, its the same for some projects i work on, but only because of the automated minfying Process that is part of every release.


26

Today, in our work as in our life, it is more important know how to find information rather than know the information itself. I mean that a good developer is a person able to find documentation, network, and that share with an open mind. I am an experienced .NET developer and, believe me, for every project I work on I have to learn new things about the ...


25

Never expose direct access to your database from the web layer. You can never lock that down; someone will send "DROP TABLE table" to your server, however much you lock down the JS source. All they have to do is see what the browser sends to your server to detect that your server accepts arbitrary SQL commands. Not that you can lock down the JS code; it is ...


21

Wow, I know this may go against some people's ideas about crawling then walking and then running. But Javascript is not some awesome language you need to totally understand and then you'll be a whizbang programmer. Just use JQuery and have fun. Use it wiseley, use it cleverly! I did my company's website 3 years ago with just Javascript and replaced ...


18

JavaScript certification is called github. It's called write modules, maintain modules, and share modules with the community, build popularity, etc. As a JavaScript employer I couldn't care less what certification you have, I care about either examples of github modules showing quality code or live websites/web applications show high quality code.


16

2072-rated chess player here. I made this website in pure JavaScript over a weekend. It's not a chess engine (I designed it to create entertaining opening positions as sort of a perverse Chess960 engine), but it's a starting point. The source code is here. There are a lot of complications involved in making a functional board. These include: First, ...


16

There are advantages, but it's debatable whether they really outweigh the drawbacks. The main one is that you save bandwidth and gain faster responses. jQuery adds another ~30kb to your response. On some networks (and in some countries), that could mean a few more milliseconds. On the other hand, though, you can set up caching for it rather easily using ...


15

You should upgrade with each release of jQuery -- just take a peek at the update logs before updating. The jQuery team is very good about documenting API changes, and -- even when the API does change -- it's not uncommon for them to support deprecated calls. At this point, the vast majority of the API is quite stable and probably won't change. Most changes ...


15

There's no technological reason why they couldn't. However, it's not necessary and it's against the web's fundamental philosophy. It's not necessary, because you can achieve almost the same thing with a far future expires header. It's against the web's philosophy because it causes there to be a top-down, centralized authority on which libraries ...


15

Actually, what you're describing exists already for years. It's called caching. And it's available not only for JQuery, but for everything your browser may download. Then sites could check "local" first, before CDN, before finally defaulting to downloading from the website server itself. This is exactly what every browser does. It checks local cache ...


14

They're looking for JavaScript - and they may not know about JQuery To gain the broadest possible audience for their advert, companies will often just state the top level technologies for the job. The vast majority of major websites using JavaScript will have some reliance on an underlying framework such as JQuery, YUI, Prototype and so on. I would ...


14

In a very quick summary: GPL: if you use my code in yours, you must distribute your code as I do for mine; LGPL: if you modify my code, you must distribute your modifications MIT: do what you want with my code excepted pretend that the code is yours Then there is the fine prints which may confuse the matter and the political goals of the FSF -- but some ...


14

Mission and philosophy: jQuery set out to make DOM manipulation easier to use, and had a single minded focus on achieving that goal. Other frameworks like Mootools and Dojo focused on making it easier to create complex applications, an idea that was ahead of its time (in 2007), and split the attention of the community and created unnecessary complexity for ...


14

Update your version of jQuery if and only if you need some new feature that's included in the new version. Simple as that. If you frequently develop using jQuery, keep an eye on the official blog to know when updates are released and what they offer. Wait a couple of weeks or so before upgrading to the latest version to make sure any unexpected bugs get ...


14

People like being black and white. If you're going to use a cross browser normalization tool then use it. Don't use it to normalize some things but not others. Example var a = $("#foo"); var b = document.getElementById("bar"); Those two should not be mixed. Either you use jQuery for edge case bugs you might care about or you use the DOM for speed, but ...


14

For web apps, yes, I think it's okay to require JavaScript because it's the nature of web apps to provide a rich, interactive user interface. More simple websites like blogs, portfolios or brand websites should be able to work without JavaScript, in my opinion. I make all my websites work without JavaScript. I know a few people who disabled JavaScript or ...


14

Well, check out by yourself: http://jsperf.com/gebi-vs-sizzle/2 jQuery slows down your application. A lot. However, as you can see on this jsperf, the operation, even though it's 10x slower than vanilla javascript, it can still run over 400k operations per second. Except if you're programming for mobile browsers, the performance loss will not be ...


14

No - the $ function is actually only overloaded for three tasks. Everything else are child functions that just use it as a namespace.


13

Under the definition of the MIT license, it is perfectly permissible. They are not distributing it, and even if they were, they would only have to include a copy of the license file (not required to be the header of each file).


12

XML really is a pretty horrible way to represent structured data, but unfortunately it gets (ab)used quite a lot by a lot of developers and websites. So if you're only working with your own stuff, then by all means, stick to JSON and save yourself the hassle. But you still need to learn XML for those times when you end up having to interoperate with ...



Only top voted, non community-wiki answers of a minimum length are eligible