Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Learning Javascript & AJAX
22 points by bgnm2000 on Oct 17, 2009 | hide | past | favorite | 23 comments
Hey Everyone,

I've taken a class in javascript before, and I've been using mootools and JQuery for awhile - but I haven't really kept up with it enough to become a hand coder. Can anyone recommend any great books or online tutorials?




I'm going to recommend Douglas Crockford's "JavaScript: The Good Parts". It will really show you how to get the most out of the language and avoid the nasty pitfalls.

As a side note, I attended a talk by him last night on this topic, and wrote up a summary. For a preview of the book, you may be interested in checking out http://www.felixcrux.com/posts/douglas-crockford-talk-waterl...


In addition to Douglas Crockford's book, which is excellent, I'd also recommend the 2nd edition of "Professional Javascript for Web Developers" by Nicholas Zakas.


the crockford book is really good, but in reality the best thing is practice. javascript is a tricky language, and crockford helps to simplify it, but you can get a lot of practical knowledge on how to use the language and jquery just by practicing a lot (sorry). but read crockford too :P

also heard an oreilly cookbook for js is coming out soon, may be worth looking into if youre into those.


Thanks for the review of Crockford's book.


I would honestly recommend reading through some of the code and trying to figure out what it's doing. Find a function in jQuery you use all of the time and figure out how it accomplishes it's goal. Also, John Resig has a decent (albeit may miss some of the points you'll need) tutorial application: http://ejohn.org/apps/learn/

(Edit: I'd also recommend any time you need anything, look to see if it exists first regardless of how small it is. And http://www.w3schools.com/jsref/ will help you enormously.)

As far as AJAX, I'd recommend to just understand how it SHOULD work. Understand what the Xhrconn object you have should contain and what you should be able to retrieve from the "raw" object if you need to do so. Trying to understand where it fails in IE, Firefox, Safari, and Opera is overkill (there are so many little bugs!).


There's nothing wrong with continuing to use jQuery. In fact, there is actually something wrong with "hand-coding" things for the sake of avoiding jQuery. Spend your time where it will make a difference.


What you're saying might be true, but some of us, like me, like to understand what's under the hood. Learning javascript from scratch, in my opinion, is a great way to fully take advantage of what javascript has to offer.


The trick, with something like jQuery, is to learn enough to begin to understand why you're lucky you didn't have to implement it yourself.

At that point you stop, thank the deity of your choice for the existence of people who abstract away browser incompatibility so you don't have to worry about it, and move on to something else.


Yep. Spend your self-education time on something more productive than recataloging the bugs in Internet Explorer.


Well stated. You loose momentum in becoming a better programmer by getting bogged down in trivia of no real consequence.


Agreed. I'm building a GWT app right now. I know Java inside/out. I don't know all the browser quirks and JS very well. I could spend time to learn it, but GWT seems to solve the problem for me so far. I have hit a few cross-browser issues with some CSS and Regex, but I was able to identify them and solve them fairly quickly.

GWT may not be the solution for you if you aren't a Java guru, but if you are, it is a godsend if you need to develop ajax ria apps quickly and you don't want to learn (deal with) all the browser incompatibilities and js nuances.


No, it's not. There is a huge difference between Javascript the language and "Javascript" the browser programming interface (also known as DOM, DHTML, $&^& $&^!#), and childNodes[0].childNodes[1].childNodes[4].nodeValue).

Learning the former is good for you. jQuery will help you do that.

Learning the latter is actively bad for you. You're learning a technology that is already obsolete.


I was in the same shoes as you were. I really enjoyed Javascript & AJAX 7th ed. by Negrino & Smith. It's an easy read and has great examples. It nicely builds up from simple javascript to DOM manipulation, JSON, AJAX, and ends with a brief touch up on javascript frameworks.

As I was reading this book at the same time I set myself a goal to build a simple implementation of Lightbox without using Jquery or any framework. As I read more, the easier it became. So as you read, you might want to choose something to construct to practice and fully understand what you're reading.

A great continuation for it was Pro Javascript Techniques by John Resig.


I just wanted to add, that I don't plan to stop using JQuery or MooTools,

I want to understand javascript better, so my implementations of mootools and JQuery tools could become more impressive.



I will recommend the book i'm currently reading: Secrets of the Javascript Ninja: http://jsninja.com/. It is written by Jquery author, and it shows you basically how a framework like JQuery would be written. It is not a book for the faint of hearts, very in depth treatment of various aspects of javascript, such as functions/closures/timers/cross platform javascript development etc. You probably need Wrox Professional Javascript for Web Developer (2009) to brush up on the basics first. Happy coding!


I rarely use anything other than O'Reilly's"JavaScript: The Definitive Guide, Fifth Edition" (http://oreilly.com/catalog/9780596101992/). It may be a bit advanced if you haven't done much programming before and is probably more of a reference book, but it covers a ton of topics and has a lot of working examples.


Jeremy Keith's "Dom Scripting" is a pretty good guide for getting up to speed with the basics of good JavaScript coding. If you want to transition to something more advanced later, I'd suggest "Pro JavaScript Design Patterns" by Dustin Diaz.


I want to echo the sentiments of others regarding the value of continuing to use those libraries. A lot of real world programming is about knowing when to use libraries and which libraries to use.


I felt that knowing javascript in an expert fashion would enable to do much more amazing things with those libraries.


It sure would, I just don't think there's any reason to mess with low level stuff like XMLHttpRequest objects. For javascript itself, this book is always good : http://www.amazon.com/JavaScript-Definitive-Guide-David-Flan... If you haven't seen O'Reilly's safari yet, that's quite a nice program if you are still in school learning a variety of things.


I am a huge fan of JQuery.

I think the JQuery website provides a great resource for learning and using it.

http://docs.jquery.com/Main_Page


I like http://www.xul.fr/en/ tutorials.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: