Simply JavaScript
N**R
Solid Javascript - from beginner to advanced.
Simply Javascript by Kevin Yank and Cameron Adams lives up to the subtitle of Everything you need to learn Javascript from scratch. Javascript is a tricky subject to tackle. The Internet is full of Javascript snippets and code samples everywhere you look. Often times these code samples are less than satisfactory when you are addressing accessibility within your website. Many of the code samples contain outdated and proprietary code samples, making it a task to work out kinks and debug. The good news with this book is that they stick to a standard. All code used in this book uses object literal notation. Sticking to a coding style and format helps make this book an incredible read. Throughout this book you will learn the underpinnings of Javascript and how you can achieve different tasks.Learning Javascript from scratch can be a daunting task. After all, there are several libraries and free scripts that you can essentially download and plugin to your website. But what happens when things go wrong? What happens when you need to modify the script to fit your needs? Having a solid foundation and understanding of Javascript will help you as you begin to develop for your own needs. This book gently walks you through the steps you need to take to achieve that solid foundation.Chapter 1 starts off with a brief primer of unobtrusive Javascript and it's role in the three layers of the web. HTML is your content. CSS is your presentation. Javascript is your behavior. These three aspects need to be separate from one another and also co-exist at the same time. Gone are the days of inline event handlers and functions. Using the power of the DOM you can rest assured your HTML will be pure and your applications will work flawlessly without Javascript enabled.Chapter 2 spends some time setting up the foundation for beginners. This chapter walks you through statements, comments, variables and different variable types, conditions and loops, functions, and objects. Whew, that was a mouthful. This is where the standard of coding is introduced that will be used throughout the rest of the book. Things such as code indenting and formatting are touched on as well. This allows you to write clean code that is readable by you and other developers who may be working with your code. As stated earlier, all code uses object literal notation, and therefore this is explained in this chapter. A few examples are given and we are off to building some handy tools.Chapter 3 gives you the necessary road map. This chapter is devoted to traversing the Document Object Model. A few helper classes are shown here that will allow us to retrieve elements by class name, add class names to an element, remove class names from an element, and check for the existence of class names within in an element. These will be used extensively throughout the book and are placed in their Core object. In addition to being able to traverse by class names, there is also the list of standard elements such as getElementById and getElementsByTagName. With these powerful tools at our finger tips we can now begin altering our pages as deemed necessary. The example given here is one of striping table rows. For those who don't do this on the server side, this simple task allows you to stripe your rows via the DOM.Sure it's cool to add stripes to a table, but how can we do more? Chapter 4 is all about Events and the power they add to interacting with the DOM. The brief history lesson in this chapter helps us understand the different interpretations of different browsers and how we can use object detection to abstract these tasks into the Core object. Event Listeners and Event Handlers are both discussed in great detail. We move on to two working examples: Rich tooltips and Accordion. Rich tooltips are used to extract information from our title attribute and then apply them to a more stylish hover tooltip effect. Accordion allows us to save space on our pages by gradually showing the content as it is requested by either a click or keyboard event.Chapter 5 gets us moving even more. This chapter is devoted to Animation and is probably one of the more complex chapters of the book. We are introduced to two methods, setTimeout and setInterval. Working mainly with setTimeout we are able to achieve our animation effects. This chapter looks at the principles of animation and an example of path-based motion with a soccer ball. We then use our new-found knowledge to extend our tooltip to show after a specified time, and our accordion is given a nice slide effect. We simply extend the code from our previous chapter to make these things happen. This is a good example of the benefits of working with objects and decoupling inside of your Javascript.Chapter 6 gives use a few more tools to work with Forms. Forms are never easy to manipulate. Whether it be the style or the behavior. The beginning of the chapter starts with smaller scripts and examples of manipulating forms. This is done by specifying dependent fields and only showing them when necessary, and creating cascading menus from a select and it's optgroup. We then move on to some more advanced features for validation and creating a custom slider. These have been presented before in other areas, so nothing is really new in this area. However, this is all a part of understanding the bigger picture and the possibilities. It is about getting the creative juices flowing.Chapter 7 discusses the inevitable testing for errors and debugging your application. We walk through the different types of erros: syntax, runtime, and logic. With each of these code samples are given with errors. We then use the tools of the browsers to make sense of their often cryptic error messages. In order to debug Javascript there is an invaluable tool in Firebug, a plugin for the popular Firefox web browser.More interaction is still left as chapter 8 moves us to AJAX. Some very strong disclaimers are made as to when and where to use the right tool for the right job. Caution is also given in regards to assistive devices such as screen readers. With the warnings out of the way, we move to a some practical examples. The first is a small weather widget and the second is an extension to form validation.The book finishes off by looking too the future of Javascript. Discussions of Rich Internet Applications and their place inside of the web help to stimulate your mind as you think about the possibilities. Not only about building applications on the web, but also using Javascript for such things as Dashboard Widgets and even browser development. In the hands of responsible developers, the future looks exciting for Javascript.The Appendix is a very important part to this book, and I like its placement. The appendix goes through the Core methods used throughout the entire book. But why wait until the end of the book? Had this chapter shown up earlier it would have caused more confusion than necessary, and more explanation that necessary. As a reader you have the option to read this appendix first, but I felt it was well placed and covered thoroughly at the end of the book. By this point in the book you will have gained enough knowledge to dive in, whereas the beginning might have left you asking all the wrong questions.If you have been developing Javascript for any amount of time, then you are most likely aware of the array of libraries available to us. These include Prototype, Scriptaculous, jQuery, Dojo, MooTools, and YUI to name a few. Each chapter of this book ends with a discussion of the libraries and how they can be used to help achieve the different tasks. Some libraries can achieve some tasks, while others still take a little work. The authors give a fair coverage to the libraries but do not dwell on them as the end-all-be-all of Javascript. If anything, the author's stress that you understand your Javascript at the core and know why you are doing what you are doing. This book sticks to unobtrusive principles and doesn't take shortcuts. The authors strive to make sure the code is of high quality and compatible cross-browser, but they never take the easy way out. Things such as innerHTML are put away in favor of building the DOM on the fly. This adds to the overall excellent quality of this book. The excellent code coupled with beautiful illustrations make this book easy to take small chunks at a time.
W**T
Not the best for a complete beginner
The Sitepoint guys have great articles on their site and emails but I found this book very difficult to read. It didnt seem that the examples made sense, or flowed together to make sense.As Im pretty new to JS, adding that to my php work, I really had a difficult time understanding all the syntax - and that is made more difficult by now having clear, easy to follow examples.I cant and wont say that I wouldnt recommend this book because its not a bad book, I just feel that if you are as new to JS as I am, this might not be the best book to start with.
B**T
Great book, but probably not for beginners
I began the book with very little knowledge of Javascript, although I am familiar with programming concepts and it has been great. I like the informal tone, and the examples are clear and easy to understand. It is not boring like most programming books. They emphasize keeping Javascript out of the html which adds a bit more complexity to the code than the old way of putting it right into the tags. This is good because it is standards compliant, but not as easy to learn.Be forewarned, this book starts with the basics but quickly jumps into the meat of Javascript. There is serious coding here, and it is not something you can read in a day. If you are not too familiar with coding principles like arrays, objects, or functions, it might be too much too fast. I would recommend JavaScript Demystified if you are beginner to scripting or programming because it spends a lot more time on basic concepts.Overall a great beginner-intermediate book on JavaScript.
S**K
Simply Fun
This book was a great read. It had humor. The examples were fun and easy to follow. The book talked about all the popular frameworks such as jQuery, but it asked the reader to download their custom Core.js library. I did not download this library. Instead I used jQuery and was still able to complete the exercises.
T**.
Good reference.
I had this book in my library for a few years. It was a great source and learning tool when I needed to solution to the problem at hand. If you're one to collect and build physical libraries for your office, it's a good one to have.
S**R
Definitely not for beginners
The good:This book is still relevant in 2011.The bad:The premise on the back of the book is misleading - you won't be able to write your own scripts after finishing this book.What you will be able to do is grasp the fundamentals of JS, but unfortunately that would require a bit of previous/basic experience with JS.
D**D
Good Introduction To Javascript and its Uses
The Kindle sample is a good indicator of the books style and content.Anyone who is 'Doctor Who' knowledgable gets my attention immediately.It is interestng, well written and presented. Good example code.
L**S
A disappointment
I've waited nearly a month for this book to arrive and was very disappointed when it did.The first page of the preface (effectively, the first page of the book) begins with inaccurate information about JavaScript (saying it is ten years old, when it's just about 13 years old).Continuing, the book then describes how & why to embed your JavaScript inside of a CDATA section, but shows the incorrect syntax for doing so.The book makes no mention of using client-side cookies nor does it discuss the for...in type of loop, which is so valuable.Despite a previous reviewer's opinion, this book is most certainly for beginners. It does not go in depth on any one topic and makes claims about the "right" way to do things that are not always "right".I also didn't care for the authors using "inside jokes and references" that many people will not get (Dr. Who references and "You guessed wrong. No, just kidding, you're right!").What really ticked me off is that this book reads like a non-stop advertisment for the author's web site.I'll be returning this book ASAP.
D**D
Excellent
No problems, excellent, bought it for my mother, she is happy.No problems, excellent, bought it for my mother, she is happy.
G**T
Not finished yet
I'm about halfway through this book and so far have found it easy to read and more importantly easy to follow.
A**Y
Great Book, Great Advice, But Not For Beginners
This is a very good introduction to Javascript and good Javascript coding practices. The examples are useful and the simple code library provided is also very useful. However if you are a beginner then you should really have a look at a simpler book. The only reason I have not given it five stars is that the marketing of the book leads one to think that it is great for absolute beginners. The ideal audience for this book is someone who has dabbled with Javascript and now wants to take a more professional and structured approach.
K**L
recht gute Einführung in Javascript
das Buch verleiht dem Leser einen recht guten Überblick in Javascript. Ich selber habe es mithilfe dieses Werkers gelernt, bin aber doch nicht ohne weiter Hilfe des Webs ausgekommen um meine Idee zu verwirklichen. Aber ich war auch ungeduldig ;-) und habe nicht alle Beispiele durchgespielt ...
H**L
complete book
the book is made for people who want a quick way to learn javascript and i do the job and its not expensive.
Trustpilot
Hace 1 mes
Hace 2 meses