Sometimes Newer Really Isn’t Better

I normally spend a good deal of time telling readers to use the latest versions of libraries because the newer versions will have additional functionality and contain bug fixes for issues that have surfaced since the library was released. There are some situations where this tactic doesn’t work and one of them appears in Chapter 2 of HTML5 Programming with JavaScript For Dummies. The example originally displayed information about the host browser, but the property used to perform that task, browser, has been deprecated in jQuery 1.9.

The easiest way to fix this problem is to use a version of jQuery that does support this property. The change is relatively small. All you need to do is change the line that reads

to read

The change will force the application to use an older version of the jQuery library. As an alternative, you can also add a call to the jQuery migrate library so that the code looks like this:

   <title>Detect a Browser</title>

The jQuery site recommends using feature detection instead. Although this feature is directly supported in the latest version of jQuery, there are problems with it as well. The most important issue to consider is that the site tells you outright that the library might have certain features pulled without notice or with a long deprecation cycle, which means that you code could simply stop working at some point. It’s a poor way to detect the kind of browser that you’re using because it’s unreliable. The technique shown in Chapter 2 of the book is far more reliable at the moment.

The point of this post is that there aren’t any absolutes when it comes to coding practice. You need to know when to break the rules. Let me know if you encounter any difficulties with my solution to the problem at If someone has a better jQuery-oriented solution to share, contact me because I’d love to hear about it.


Working with the HTML5 Canvas

HTML5 has a considerable number of new features to offer. In fact, I discuss many of the new tags that HTML5 has to offer on page 228 of HTML5 Programming with JavaScript For Dummies. In fact, my book demonstrates a number of these tags as part of showing you how to use JavaScript to create applications that run anywhere and on most devices that support HTML5.

One of the more amazing (and least talked about) features of HTML5 is the concept of a canvas that you can draw on, much as an artist uses a canvas to create interesting pictures. I encountered an article about the HTML5 canvas the other day entitled, “All About HTML5 <canvas>” by Molly Holzschlag. In this article you get a great general overview of precisely what a canvas can do for you. I think you’ll find it quite useful, especially if your artistic skills are at the same level as mine are (nearly non-existent). The <canvas> tag makes it possible to create useful graphics in a way that most developers can understand quite easily.

This is one tag that I wish I had explored more fully in my book, but picking topics carefully is part of being a good author. Instead of providing an overview like the one that Molly provided, I chose to include a more specific example that also employs the Google API. My Working with Data Using Maps post describes just one method of working with the Google APIs. Chapters 18 and 20 both discuss methods of working with the Google API and the example in Chapter 20 combines the Google API with the <canvas> to create an interesting example.

If you’re working with HTML5 for the first time, make sure you spend time working with the <canvas> tag. It makes data presentation considerably easier, even if you lack artistic skills. Let me know about the projects you’ve created using the <canvas> tag at


More Goodies for HTML Programming with Javascript For Dummies

During the last few weeks I’ve mentioned some of the extras you can get for HTML5 Programming with JavaScript For Dummies. There are even more goodies and you can access them through the Extras page. All new Dummies books will likely include this special page where you can obtain access to the Cheat Sheet and a number of other items that will vary by book. Of course, I’ve already told you about the article on using tooltips to make your pages more accessible.

While I wrote this book, I tried to avoid too many specific references to particular products. My goal was to provide a book that anyone could use on the Mac, Linux, or Windows platforms without modification. The examples were designed to work with just about any major browser; although, I did focus on Chrome, Firefox, and Internet Explorer during testing. Even though I did follow these guideline rigorously while writing, I also used some specific tools to write my code. You can read about one of these tools in the article entitled, How to Create a New JavaScript File in Komodo Edit. Make sure you let me know whether you’d like to see more articles on this exciting editor. I’ll post them along with the other blog posts for this book.

If you have already performed some programming with JavaScript, you know that the prototype can be particularly difficult to understand. In fact, while researching this book, I noted an inordinate number of questions about this particular JavaScript element. The book does address the prototype property to some degree, but you may want a little more information. I provide it as part of the article entitled, How to Use the JavaScript Prototype Property.

Some developers make working with CSS mysterious and difficult. Fortunately, there is a way to make things simple. No, you won’t use every feature that CSS has to offer using my technique, but you’ll get an excellent start on organizing information on your site. The article entitled, How to Create Cascading Style Sheets (CSS) Simply and Easily, describes this technique in detail.

A final article for the Extras page considers the idea that many people learn by viewing what other people have done. Mimicking the actions of others is an excellent way to learn. That’s why I created Ten Really Cool Sites You Can Emulate. This is a simple list of ten sites you can use to learn by seeing what other people have done for their sites. I chose each site in the list for a specific reason and the article tells you why.

The Extras page is a good way to discover whether you’ll like my book and whether my style of writing suits your needs. I encourage you to check out the Extras page, along with the extensive list of blog posts you find here. Of course, I’m always happy to answer your questions. If you find that you need additional information before buying my book or after you start reading it, please be sure to contact me at


Using Tooltips on a Web Page

Some developers focus on functionality, rather the usability, when designing their Web pages. The tradeoff is usually a bad one because users favor usability—they want things simple. One of the issues that I find most annoying on some sites is the lack of tooltips—little balloons that pop up and give you more information about a particular item. Adding tooltips requires little extra time, yet provides several important benefits to the end user:

  • Less experienced users obtain useful information for performing tasks such as filling out a form.
  • More experienced users obtain additional information about a given topic or the endpoint of a link.
  • Special needs users gain additional information required to make their screen readers functional.
  • Developers are reminded precisely why an object is included on the page in the first place.

In short, there are several good reasons to include tooltips. The only reason not to include them is that you feel they take too much time to add. One of the added articles for HTML5 Programming with JavaScript For Dummies is entitled, “How to Create Friendlier Pages Using Tooltips.” This free extra for your book tells you precisely how to add tooltips (it demonstrates two methods, in fact) and shows how they appear on screen. The article is provided to help you obtain a better understanding of what my book is about and also helps you discover whether you like my writing style and manner of presenting information.

If you already have my book and find that you want additional information on making your site more accessible so that everyone can use it, check out another one of my books, Accessibility for Everybody: Understanding the Section 508 Accessibility Requirements. This book contains all of the information you’ll ever need to address every accessibility issue for any kind of application you want to create.

Accessibility is becoming more and more of a concern as the world’s population ages. In fact, everyone will eventually need some type of accessibility assistance if they live long enough. If you’re a developer, adding something as simple as tooltips to your pages can make them significantly easier to use. Users should request the addition of accessibility aids when sites lack them (and vote with their pocketbook when site owners refuse to add them). Let me know your thoughts about accessibility in general and tooltips in specific at


Where is the HTML5 Book Cheat Sheet?

A few people have now purchased HTML5 Programming with JavaScript For Dummies and one of the first questions that I’m asked is where the cheat sheet is. If you’ve purchased other Dummies books, you’ll have encountered the cheat sheet—a feature that includes quick tips for becoming productive quickly. The cheat sheet is normally printed on card stock and perforated so that you can easily remove it from the book. You place the cheat sheet where you can access it easily and provide tips for jogging your memory about content you saw in the book.

Don’t worry, the cheat sheet is still available, but now you access it online on the Dummies site. Now, before I get a bunch of e-mails yelling foul, yes there are some disadvantages to this new approach—the most noticeable of which is that you can’t remove the cheat sheet from your book and carry it around with you. I have to admit, not having the cheat sheet within easy reach wherever I am at the moment is a disadvantage. However, it used to be more of a disadvantage when I wasn’t always connected to the Internet. I thought about it recently and those occasions are rare today.

Let’s discuss the positives of an online cheat sheet. The following list provides some reasons that you’ll find the new cheat sheet really helpful (at least, these are reasons I like the new cheat sheet).

  • The new cheat sheet is available to everyone, even if you purchased an e-book version of the book.
  • I can make the cheat sheet as large as needed (within reason) to accommodate everything I think the reader might like to see (I often had to cut content from the old cheat sheets).
  • You now have access to live links as part of the cheat sheet so that all you need to do is click a link to see additional resources.
  • The new cheat sheet can’t get lost. Readers used to complain all the time that they had misplaced their cheat sheet (or someone had borrowed it).
  • The new cheat sheet won’t get worn out.

If you’re like me, you still like to have a paper copy of your cheat sheet around. To make the new cheat sheet as readable in paper form as possible, click the smallish Print link near the top of the page. You’ll see a less embellished version of the cheat sheet that will print cleanly no matter what platform you’re using. When the paper copy you have is lost, borrowed, or worn out, you can simply print a new one without having to ask anyone about it. Talk about convenient !

I’m always open to your input. What do you like or dislike about the new cheat sheet? Is there anything I can do to improve this new form of cheat sheet in the future? This is my first stab at this new format, so I really do need to know your thoughts so that I can polish my presentation to meet your needs. Let me know your thoughts at


Considering the Increasing Need for Security

Many of the readers I work with have noted an increase in the amount of security information I provide in my books. For example, instead of being limited to a specific section of the book, books such as Microsoft ADO.NET Entity Framework Step by Step (the new name for Entity Framework Development Step by Step) and HTML5 Programming with JavaScript for Dummies provide security suggestions and solutions throughout the book. The fact of the matter is that this additional security information is necessary.

There are a number of factors that have changed the development environment and the way you design applications. The most significant of these factors is the whole Bring Your Own Device (BYOD) phenomenon. Users bring devices from home and simply expect them to work. They don’t want to hear that their favorite device, no matter how obscure or unpopular, won’t work with your application. Because these devices aren’t under the IT department’s control, are completely unsecured, and could be loaded with all sorts of nasty software, you have to assume that your application is always under attack.

Years of trying to convince users to adopt safer computing practices has also convinced me that users are completely unconcerned about security, even when a lack of security damages data. All the user knows is that the application is supposed to work whenever called upon to do so. It’s someone else’s responsibility to ensure that application data remains safe and that the application continues to function no matter how poorly treated by the user (through ignorance or irresponsible behavior is beside the point). Because of this revelation of human behavior, it has become more important to include additional security discussions in my book. If the developers and administrators are going to be held responsible for the user’s actions, at least I can try to arm them with good information.

The decentralized nature of the security information is also a change. Yes, many of my books will still include a specific security chapter. However, after getting a lot of input from readers, it has become apparent that most readers aren’t looking in the security-specific chapter for information. It’s easier and better if much of the security information appears with the programming or administration techniques that the reader is reviewing at any given time. As a consequence, some of my books will contain a great deal of security information but won’t even have a chapter devoted to security issues.

I’m constantly looking for new ways to make your reading experience better. Of course, that means getting as much input as I can from you and also discussing these issues on my blog. If you have any ideas on ways that I can better present security issues to you, let me know at


Introducing HTML5 Programming with JavaScript For Dummies

Today marks the first day you can obtain my latest book, “HTML5 Programming with JavaScript For Dummies.” This is a really exciting book because it helps you create interesting applications using technology that works on just about every platform that exists in the world today using tools that cost little or nothing to use. Of course, these are Web-based applications—the kind that run within a browser. At one time, Web-based meant applications that provided deficient interfaces, lacked any sort of pizzazz, and just generally felt cheesy (poorly made). Today Web-based applications provide interfaces that are every bit as good as their desktop counterparts, but don’t require a special platform to work. All of the examples in the book were tested on Windows, the Mac, and Linux using several different browsers including Internet Explorer, Firefox, and Chrome. One of my beta testers even checked out a few of the examples on his smartphone and they worked just fine. (I do try to point out situations where differences between browsers or platforms will cause an application to look or act differently that what you see in the book.)

Don’t get the idea that this book is only for beginners. Even intermediate readers will be able to discover some new techniques. That said, the beginning of the book is definitely targeted toward someone who hasn’t worked with JavaScript before. Here is a list of the chapters:


  • Chapter 1: HTML, Say Hello to JavaScript
  • Chapter 2: Assessing Tools of the Trade
  • Chapter 3: Integrating HTML5 and JavaScript
  • Chapter 4: Embracing JavaScript Variables
  • Chapter 5: Working with Objects
  • Chapter 6: Getting to Know the Standard JavaScript Objects
  • Chapter 7: Using Functions
  • Chapter 8: Making Choices in JavaScript
  • Chapter 9: Making the Rounds with Loops
  • Chapter 10: Performing Error Handling
  • Chapter 11: Understanding the Document Object Model
  • Chapter 12: Handling Events
  • Chapter 13: Connecting with Style: JavaScript and CSS
  • Chapter 14: Enhancing HTML5 Forms with JavaScript
  • Chapter 15: Interacting with Windows
  • Chapter 16: Working with XML in JavaScript
  • Chapter 17: Cleaning up the Web with AJAX
  • Chapter 18: Making JavaScript easier with jQuery
  • Chapter 19: Using jQuery to handle AJAX
  • Chapter 20: Animating the web
  • Chapter 21: Ten Incredible HTML5 and JavaScript Examples
  • Chapter 22: Ten Thoughts About the Future of Web Development

As you can see, the later chapters in the book contain some really interesting topics you can use to create great sites. For example, you get to work with jQuery, possibly one of the best libraries available today. There is even an example that demonstrates how to work with the Google Maps API. The point is that you’ll start this book as a beginner, but you won’t stay a beginner for very long. Not only does the book use the Dummies approach to learning, but you get a lot of hands on experience through 108 programming examples.

I’d love to hear any questions you have about my new book. Let me know what you’d like to know at


HTML5/JavaScript Developer Beta Readers Needed

I’m starting a new book project for a book named HTML5 Programming with JavaScript For Dummies. I’ve always been excited about JavaScript because you can use it in so many places. This is the language you want to learn if you want to develop skills that transfer to any device, any operating system, and any environment that supports both HTML5 and JavaScript. This particular book will focus on applications that you typically run within a Web browser, but you can easily use the skills you learn here to perform other tasks with JavaScript.

This is a novice level book at the outset, but quickly moves toward intermediate level tasks. You won’t learn everything there is to know about JavaScript. Rather, you’ll get a great introduction to the language that will help you learn any additional skills you need at an accelerated rate.

I’m assuming that you’ve at least looked at a few Web pages in the past, that you have some idea of what tags are and know the basic tags for a Web page (such as <html>, <head>, and <body>). I’m not assuming very much. You also need to know how to use your computer with some degree of competency. I’m looking for readers of any platform that supports HTML5 and JavaScript. If you want to test my code on a cellphone, please do. I’m specifically targeting the Windows, Mac, and Linux platforms with this book, so I’d love to hear from developers in any of these environments.

It’s important to remember
that beta readers provide direct input on my books while I’m writing
them. In short, you get to help shape the final form of my book. Every
beta reader comment is carefully considered and I implement as many of
your suggestions as possible. Your input is incredibly important at this
phase and unlike many other reader suggestions, you’ll see the results
in the final product, rather than as a post on my blog after the fact.

worry about me bugging you for input. You sign up, I send the
manuscript your way, and then, if you choose to provide suggestions on a
particular chapter, you send the suggestions back to me. During the
author review process (when I answer the questions of all of my
editors), I’ll incorporate your suggestions. If you have any desire to
work with HTML5/JavaScript and would like to be a beta reader for this book,
ask for details at


Review of HTML5 Step by Step

Microsoft has thrown developers yet another curve—Windows 8 will rely on HTML5 and JavaScript for a programming interface. The revelation has many developers horrified. For me, it means updating my HTML and JavaScript skills, which was one motivation for reading the book reviewed in today’s post. HTML5 Step by Step, written by Faithe Wempen, provides a quick method of getting up to speed on HTML5.

This book is designed to aid anyone who wants to know how to work with HTML5, which means that it starts out extremely simple. The book avoids the ever popular Hello World example, but the example it does provide is small and easily understood. The chapters don’t remain simple, however, so even if you have some experience with HTML, you can use this book to update your skills. You’ll likely want to start around Chapter 3 if you are experienced and skim through the material until you come to something unfamiliar, which could happen relatively fast given the changes in HTML5.

HTML5 Step by Step is light on theory and reference information, but heavy with hands on experiences. It relies on using Notepad as an editor, which may seem like an odd choice, until you read the “Why Learn HTML in Notepad?” section of the Introduction. The author’s reasoning is akin to the same reasoning I would use, which is to make sure that the reader types everything and understands why a particular element is required. If you really want to get the most out of this book, you have to do the exercises in Notepad as the author suggests. Otherwise, I guarantee you’ll miss out on something important. Faithe has made a great choice of teaching aids in this case.

Chapter 1 is most definitely designed for the rank novice. It even shows how to set up the examples directory as a favorite in Notepad. However, unlike many books, the rank novice should read the book’s Introduction because Faithe does provide some needed information there, such as the “Understanding HTML Tags” section.

Chapter 2 gets the reader started with some structural elements. Faithe covers everything that the reader is likely to need for a typical starter Web page. I wish that the chapter had covered <meta> tags in a little more detail, or at least provided a table listing them, but this book does have an emphasis on hands on exercises, so the omission isn’t a glaring one. As an alternative to including the information, an update could provide a URL that lists the tags so the reader knows where to go for additional information.

By Chapter 3, the reader is formatting text and starting to make the sample site look pretty. I really thought Faithe did a nice job of moving the reader along at a fast, but manageable pace. She shows the reader how to make effective use of tag combinations, such as the <kbd> (keyboard) and <b> (bold) tags.

There is the smallest amount of reference information in some chapters. For example, Chapter 4 contains a table on page 50 showing the list attributes. These references are very small and quite helpful, but the reader should understand that the emphasis is on doing something and that the reference material may not be complete. For example, the special symbols table on page 56 is missing the em dash, which is something most people use.

The book progresses at a reasonable pace. Never did I find myself rushed. The examples all seem to work fine and I didn’t find missing steps in the procedures. The author uses an adequate number of graphics so that the reader doesn’t get lost. I liked the fact that every exercise ends with a cleanup section and a list of the major points that the reader should have gotten from the exercise.

Readers who are only interested in new tags will need to wait until Chapter 9 to see one. The <figure> tag makes an appearance on page 141. However, even some professionals didn’t use all of the HTML4 tags and it really does pay to start at Chapter 3 and look for something you don’t recognize. It may surprise you to find that an earlier chapter contains a somewhat new (but not new to HTML5 tag) that you’ve passed by.

There are a few nits to pick with this book. The first is that the author places the accessibility information in an appendix where almost no one is going to read it. The information should have appeared as part of the rest of the book as appropriate. In addition, the author misses the big point that most people today have some sort of special need addressed by accessibility aids. The number of people who are colorblind alone is 8 percent of the male population and 0.5 percent of the female population. This book is unlikely to help you create a truly accessible sitenot that this is the reason you’re buying the book.

The second is that Appendix C doesn’t really help very much with the additions and subtractions for HTML5. For example, Appendix C doesn’t tell you about the new <aside> tag. If you want a quick list of the new tags, check out the HTML5 New Elements page. (I checked the missing <aside> tag against a number of other sites, such as The point is that Appendix C won’t give you the complete picture. Again, this isn’t one of the selling points of the book, but the list should have been complete.

The third is that there isn’t really enough information about why something is done or why it changedsimply that it must be done or that it did change. The reader probably doesn’t want a full blown history of the change, but the why of something can make understanding and, more importantly, remembering a concept easier. Still, this particular nit is minor since the purpose of the book is to get you started with HTML5 quickly and not to explore it at a theoretical level.

Overall, HTML5 Step by Step is a great book for the novice who wants to learn how to create Web pages. It’s also an acceptable book for someone who’s experienced with HTML coding, but wants to get up-to-date on the HTML5 changes quickly. This book is definitely designed for someone who wants to do something, rather than simply read about it. If you don’t perform the exercises, you won’t get much out of the book.